forums › forums › SQLyog › Using SQLyog › sja can't connect to /var/lib/mysql/mysql.sock
- This topic is empty.
-
AuthorPosts
-
-
April 30, 2005 at 6:11 am #8943AnonymousGuest
hi,
i am always getting the error
“Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)Could not connect to SOURCE MySQL server”
well, that's because the mysql.sock is in /tmp. i have specified this in my.cnf and restarted the database, but sja still appears to look for mysql.sock in /var/lib/mysql
is there anyway i can specify the location of mysql.sock to sja ?
many thanks
jamie
-
April 30, 2005 at 6:41 am #17571RiteshMember
Thanks for the report.
I have forwarded it to my development team.
-
April 30, 2005 at 4:28 pm #17572AnonymousGuest
hi ritesh.
will you announce it here on the main page when it is fixed?
thanks
p.s. in the meantime i have simply changed the socket location.
in case someone else has this problem, here is how i fixed it:
if the directory /var/lib/mysql doesn't exist than create it and chown to user mysql:
mkdir /var/lib/mysql; chown mysql /var/lib/mysql
i then edited the /etc/my.cnf file and specified
[mysqld]
socket=/var/lib/mysql/mysql.socket
[client]
socket=/var/lib/mysql/mysql.socket
i then restarted the mysql server (etc/init.d/mysql restart)
that is enough for mysql. however if you use it with php, the chances are that php was compiled with a different default mysql socket location (e.g. /tmp/mysql.sock). in which case you have to edit the php.ini file and find the variable “mysql.default_socket”. set this to the above value
mysql.default_socket = /var/lib/mysql/mysql.socket
and restart apache to re-read the php.ini file
the mysql docs are here:
http://dev.mysql.com/doc/mysql/en/problems…mysql-sock.html
hth
-
October 27, 2006 at 9:24 pm #17573tumerotataMember
Hello, I resolved this problem creating a link to the socket:
Code:# cd /var/lib/mysql/
# ln -s /var/run/mysqld/mysqld.sock mysql.sockI'm using debian sarge and mysql 4.1
😆
-
-
AuthorPosts
- You must be logged in to reply to this topic.