cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL error message

Andrew Kaplan
Super Advisor

MySQL error message

I am setting up a MySQL server and I wanted to run some benchmark tests. When I tried to run the run-all-tests script under mysql-bench, I got the following error message:

DBI connect failed: Can't connect to local MySQL server through socket '/var/llib/mysql/mysql.sock' (2)

What do I need to change to correct this? Thanks.
A Journey In The Quest Of Knowledge
2 REPLIES
Stuart Browne
Honored Contributor

Re: MySQL error message

This usually means that the mysqld hasn't been started.

The other possiblity is that the 'mysql-bench' is looking for the local-socket file in a different place. '/var/lib/mysql/mysql.sock' in this case, where as your mysql server is quite possibly putting it in a different place ('/tmp/mysql.sock' is not uncommon).

You'll need to verify that your mysql daemon is started, and see where it's putting it's socket file. If it's not '/var/lib/mysql/mysql.sock', then make a symbolic link to it at that location:

ln -s /real/path/to/mysql.sock /var/lib/mysql/mysql.sock

This should allow everything to work.
One long-haired git at your service...
Suresh Pai
Advisor

Re: MySQL error message

if mysqld is running,
see if you have a /var/lib/mysql/mysql.sock and if so, whether it has access rights to mysql:daemon