2
votes

Can not start mysql .. ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/tmp/mysql.sock (2)

I use mysql51. I've tried reinstalling but nothing works ...

3
mysql is not running, or the mysql socket file is not in /tmpMarc B
in the output of ps ax, do you see the mysqld process?fvu
Yes, mysql is not running and I do not have mysql.sock No fvu, I do not have the process.Crazy

3 Answers

1
votes

After installing MySQL for the first time run:

mysql_install_db --user=mysql 

and

mysqld_safe &

and setup your root password with:

/usr/local/bin/mysqladmin -u root password 'your_passwd' 
0
votes

As Marc B has pointed out in the comments, mysql is not running.

In console (as root/admin), type;

/usr/local/etc/rc.d/mysql-server start

This should start the service, and you should be good to go.

Source

0
votes

Try following command line:

sudo chown -R _mysql:mysql /usr/local/var/mysql
sudo mysql.server start