Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
# Start your mysql server
/etc/init.d/mysql start
3.2
5
#/usr/sbin/mysqld --defaults-file=/etc/mysql/my.cnf --basedir=/usr --datadir=/var/lib/mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock
Thank you!
5
0
0
0
# this saved my ass
# first you must perform a graceful shutdown of the server from the command line rather than powering off the server
shutdown -h now
# an additional method for getting it back up again when you run into this problem is to move mysql.sock
# to centos
mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql.sock.bak
# to ubuntu
mv /var/run/mysqld/mysqld.sock /var/run/mysqld/mysqld.sock.bak
# restart mysql
service mysqld start
Thank you!
0
0
0
9
service mysql start
Thank you!
9
0
4
6
sudo apt-get install mysql-server
Thank you!
6
0
Are there any code examples left?
New code examples in category SQL