small medium large xlarge

Generic-user-small
02 Oct 2011, 01:06
Jason Hsu (12 posts)

I’m still on chapter 16, and I can’t get MySQL to work properly. When I enter “mysql -u root”, I get:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (13)

I created the /var/run/mysqld and the mysqld.sock file within it, but I couldn’t give mysqld.sock mysql ownership (invalid user).

Samr_small_pragsmall
02 Oct 2011, 11:09
Sam Ruby (634 posts)

First, delete that directory and file, as they should be created by the running mysql daemon. Things to try:

Verify that the mysql server is installed:

sudo apt-get install mysql-server

Verify that the mysql daemon is running:

sudo mysqladmin ping

See if you can start the mysql daemon:

sudo service mysql start

Look for error messages in the log:

tail /var/log/mysql/error.log
You must be logged in to comment