LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   did anybody figure out mysql.sock error? (https://www.linuxquestions.org/questions/linux-software-2/did-anybody-figure-out-mysql-sock-error-148599/)

needforspeed 02-20-2004 09:38 PM

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?

comp12345 02-20-2004 10:14 PM

Check your mysql logs for any error messages. Try "netstat -a |grep mysql". If mysql is indeed running, it should show up.

needforspeed 02-20-2004 10:42 PM

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?

looseCannon 02-20-2004 10:54 PM

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.

needforspeed 02-20-2004 11:01 PM

I don't have that file in /tmp either

looseCannon 02-21-2004 09:03 AM

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.

akash1496 10-31-2018 06:52 AM

Quote:

Originally Posted by needforspeed (Post 772028)
I don't have that file in /tmp either

Can you share conf file for more information?

scasey 10-31-2018 04:57 PM

Quote:

Originally Posted by akash1496 (Post 5921207)
Can you share conf file for more information?

This thread is 14 years old. If you have a question, please start a new thread with your specific question/problem.

Thanks, and welcome to LQ


All times are GMT -5. The time now is 11:41 PM.