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? |
Check your mysql logs for any error messages. Try "netstat -a |grep mysql". If mysql is indeed running, it should show up.
|
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? |
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.
|
I don't have that file in /tmp either
|
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. |
Quote:
|
Quote:
Thanks, and welcome to LQ |
All times are GMT -5. The time now is 11:41 PM. |