Cara mengatasi error ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
1. buka configurasi my.cnf, edit seperti dibawah ini kemudian simpan!
# The following options will be passed to all MySQL clients
[client]
#socket = /tmp/mysql.sock
socket = /var/run/mysqld/mysqld.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
#socket = /tmp/mysql.sock
socket = /var/run/mysqld/mysqld.sock
2. Buat folder mysqld/ di direktori /var/run/ :
sudo mkdir -p /var/run/mysqld/
3. Then create a mysqld.pid file with touch:
sudo touch /var/run/mysqld/mysqld.pid
4. Next create a mysqld.sock file with touch:
sudo touch /var/run/mysqld/mysqld.sock
5. Now change the ownerships of the directory and files to mysql:mysql like this:
sudo chown mysql:mysql -R /var/run/mysqld
6. And restart MySQL like this to get those files set and created:
sudo service mysql restart
0 comments:
Posting Komentar