LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-20-2004, 10:38 PM   #1
needforspeed
Member
 
Registered: Aug 2003
Distribution: Gentoo
Posts: 73

Rep: Reputation: 15
did anybody figure out mysql.sock error?


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

that's the error I'm getting after installing the rpm for 4.something.

Everything worked fine with the one that installed with RH9. I searched this site and google and still haven't figured out this problem. From what I can tell, I don't have a mysql.sock file where it's supposed to be and I don't know how to get it. mysql does start on startup, is currently running, but I can't connect to it so I can't do anything with it. I read a lot of posts on here and the web and the only people that seem to have had success had to reinstall their OS and install mysql from source. I don't want to do anything that drastic. Any help?
 
Old 02-20-2004, 11:14 PM   #2
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
Check your mysql logs for any error messages. Try "netstat -a |grep mysql". If mysql is indeed running, it should show up.
 
Old 02-20-2004, 11:42 PM   #3
needforspeed
Member
 
Registered: Aug 2003
Distribution: Gentoo
Posts: 73

Original Poster
Rep: Reputation: 15
when I type "netstat -a | grep mysql" I get:

tcp 0 0 *:mysql *:* LISTEN
unix 2 [ ACC ] STREAM LISTENING 4718 /var/lib/mysql/mysql.sock

I can restart mysql in the services window and it says successful. I really don't know a whole lot about mysql but I'm trying to learn now. I don't know where the log files are either. A lot of people seem to be having this problem so I think that there would have to be a bug or something in mysql.

I tried running mysqld_multi with the following option but I couldn't get it to work right either, just kept showing me the help:

--tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead
of the UNIX socket. This affects stopping and reporting.
If a socket file is missing, the server may still be
running, but can be accessed only via the TCP/IP port.
By default connecting is done via the UNIX socket.

I don't have the socket file, so I just tried creating an empty file and putting it where the my.cnf file said it was looking for it but that didn't work. Is it possible to use a copy of somebody else's file? Or would that even work at all?
 
Old 02-20-2004, 11:54 PM   #4
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Rep: Reputation: 31
I've had this problem before. The mysql.sock file is in /tmp, I made a symbolic link from where it's looking to the one in /tmp and it worked fine after that.
 
Old 02-21-2004, 12:01 AM   #5
needforspeed
Member
 
Registered: Aug 2003
Distribution: Gentoo
Posts: 73

Original Poster
Rep: Reputation: 15
I don't have that file in /tmp either
 
Old 02-21-2004, 10:03 AM   #6
looseCannon
Member
 
Registered: Dec 2003
Location: Little Rock, AR
Distribution: Fedora Core 2, AIX, HP-UX, Solaris, Whitebox
Posts: 193

Rep: Reputation: 31
The mysql.sock file is only present when mysql is running. Are you sure it is started? Can you connect to it using the ip address (mysql -uUserName -pPassword -hIPAddress)?

If the answer to both of those is "yes", then either use 'find' or 'locate' to see where the mysql.sock is.

I checked out my RH7.3 machine. It is putting the mysql.sock in /var/lib/mysql, but I'm running 3.23, probably not the same version your using. I had to create link from /tmp/mysql.sock to /var/lib/mysql/mysql.sock. That fixed the problem, of connecting locally, but I was always able to connect if I treated it as a remote connection.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-08-2008 12:48 AM
can't connect mysql.sock error mabus92920 Linux - Newbie 6 04-15-2005 11:38 PM
MySQL 3.23.58-14 installation prolem - mysql.sock not found lightcom Linux - Software 4 02-23-2005 01:46 AM
can't connect to mysql through socket '/tmp/mysql.sock' Boby Programming 2 05-23-2004 02:32 PM


All times are GMT -5. The time now is 04:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration