LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2005, 08:09 PM   #1
ebarreto
LQ Newbie
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: REDHAT
Posts: 4

Rep: Reputation: 0
Question MySql server socket connection


after loading mysql from RedHat distb. Linux 3 (under root), I immediately
executed the application and got this error:

Error 2002 : Can't connect to local MySQl server through socket
'/var/lib/mysql/mysql.sock' (2)

The /etc/my.cnf file contains:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
.
.



What am I doing wrong?
Thanks
EBarreto
 
Old 01-04-2005, 02:19 AM   #2
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
Hello ebarreto,
I think that your mysql server is not running. So first start your mysql server.
Be a SU and give this command :
[root@locahost root]# service mysqld restart
[root@locahost root]# mysql

I hope that will do the magic.
 
Old 01-04-2005, 05:03 AM   #3
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Which version of RedHat do you have??!
 
Old 01-04-2005, 04:18 PM   #4
twantrd
Senior Member
 
Registered: Nov 2002
Location: CA
Distribution: redhat 7.3
Posts: 1,440

Rep: Reputation: 52
He probably means RHEL v3.0.

For the mysql.sock problem:

1. Make sure mysqld is running.
2. If it is running and you are getting this, make sure the permissions are correct.

-twantrd
 
Old 01-04-2005, 04:20 PM   #5
ebarreto
LQ Newbie
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: REDHAT
Posts: 4

Original Poster
Rep: Reputation: 0
Hello Proud,


RedHat Linux ES, Kernel 2.4.21-4.EL

It seems that the file :/var/lib/mysql/mysql.sock
was not created during installation.

Thanks for reponding,

ebarreto
 
Old 01-04-2005, 04:27 PM   #6
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
So did you try checking that mysql is running and is it working ok now?
 
Old 01-04-2005, 04:31 PM   #7
ebarreto
LQ Newbie
 
Registered: Jan 2005
Location: Puerto Rico
Distribution: REDHAT
Posts: 4

Original Poster
Rep: Reputation: 0
Hello tanveer,

It seems that mysqld was not installed. When I try to
start the service I get : mysqld: unrecognized service.
I'm using Linux ES 2.4.21-4.EL

Thanks for reponding

ebarreto
 
Old 01-04-2005, 04:40 PM   #8
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Try service mysql status.
 
Old 01-04-2005, 09:06 PM   #9
tanveer
Member
 
Registered: Feb 2004
Location: e@rth
Distribution: RHEL-3/4/5,Gloria,opensolaris
Posts: 525

Rep: Reputation: 39
Hello ebarreto,
Give this command ntsysv. If you find an entry like mysqld there then its already installed and you just have to enable it.
If its not there then following :
First check if you have installed these packages
1. mysql : contains a lot of client programs
2. mysql-server : contains the server daemon and the mysqld start-up script
3. mysqld-devel : libs and header files
4. php-mysql : if u want ot work with php & mysql

To find out if they are installed just give this comand: rpm -qa | grep mysql
let us all know the outcome.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
MySQL connection LINUX domain Socket problem herambshembekar Programming 2 10-18-2002 12:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration