Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'.

Make sure that you have installed the mysql-server. if not then use the following command to install it: $sudo apt-get install mysql-server

Follow the Following Steps:

Stop mysql: $sudo /etc/init.d/mysql stop  
Start MySQL in safe mode: $sudo mysqld_safe --skip-grant-tables &  
Log into MySQL using root: $mysql -u root  
Select the MySQL database to use: $use mysql;  
Reset the password: $update user set password=PASSWORD("yourPassword") where User='root';  
Flush the privileges: $flush privileges;  
Restart the server: $quit  then  $sudo /etc/init.d/mysql restart (References)

Post a Comment

0 Comments