Mittwoch, 26. Januar 2011

Can't connect to local MySQL server through socket

My problem occured after I increased the size of the MySQL query_cache_size. The first step to fix this problem was to stop the MySQL server through the init.d script:

/etc/init.d/mysql stop


After I changed the query_cache_size setting in /etc/mysql/my.cnf to 16M

So I tried to start the MySQL server again but the following error message was shown:

Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!


And in the syslog:

Jan 26 16:14:34 1106-28-18 /etc/init.d/mysql[25916]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Jan 26 16:14:34 1106-28-18 /etc/init.d/mysql[25916]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Jan 26 16:14:34 1106-28-18 /etc/init.d/mysql[25916]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Jan 26 16:14:34 1106-28-18 /etc/init.d/mysql[25916]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Jan 26 16:14:34 1106-28-18 /etc/init.d/mysql[25916]:


So I took a look to the /var/run/mysqld/ directory if there is a mysqld.sock file, it was not there so I created it and made the mysql user to his owner:

chown mysql /var/run/mysqld/mysqld.sock
touch /var/run/mysqld/mysqld.sock


After I started MySQL with the init.d script the server runs like it should

0 Kommentare:

Kommentar veröffentlichen