Click to See Complete Forum and Search --> : Cant start MYSQL
brokeitagain
05-22-2003, 04:35 AM
Get the following message when trying to start Mysql:
ERROR 2002: Cant connect to local MySQL server through socket 'var/lib/mysql/mysql.sock (2)
Can someone tell me what this means and steps to rectify.
This mysql.sock, is it a virtual thing created during mysql start, or an actual file that should exist in the mysql dir? If a file, how do I create it ?
Thanks in advance
DJBanaan
05-22-2003, 05:17 AM
Take a look in /tmp to see if mysql.sock is there, if so, take a look at your my.cnf which should be in /etc. Look for these lines
[client]
port=3306
socket=/var/lib/mysql/mysql.sock
[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock
and change them to
[client]
port=3306
socket=/tmp/mysql.sock
[mysqld]
port=3306
socket=/tmp/mysql.sock
If you don't have my.cnf in /etc you can copy a .cnf from the support-files directory in your mysql directory and rename it to my.cnf. For instance "cp my-small.cnf /etc/my.cnf".
brokeitagain
05-22-2003, 06:13 AM
my.cnf file is as you described. seems that the mysql.sock file doesnt exist on the machine anywhere!
is there someway of creating it?
DJBanaan
05-22-2003, 06:24 AM
Check your permissions, the mysql.sock is created at mysqld startup. So you might try running as root : "safe_mysqld --user=root". That should get you passed al permision related things, but mind you, for testing only.
brokeitagain
05-22-2003, 06:35 AM
tried the "safe" start. mysql.sock appears in /var/lib/mysql/mysql.sock.
mysqld daemon starts, then nothing. just seems to be hung mid process or something.
will changing the my.conf to point to /tmp sort this out??
brokeitagain
05-22-2003, 06:51 AM
changed the my.conf to /tmp/msql.sock.
ran "mysqld --user=root" , mysql seems to have started and is "ready for connections".
many thanks :p
DJBanaan
05-22-2003, 07:14 AM
Keep in mind that running MySQL as root is a bad idea. It is better to make sure that your mysql user has permissions on the datadir and on /tmp to create the sock file. Then you can start with "safe_mysqld --user=mysql"