Posted in Mysql

MySQL | Access denied for user ‘root’@’localhost’

Symptom

$ mysql -u root

ERROR 1698 (28000): Access denied for user ‘root’@’localhost’

$ /usr/bin/mysqld_safe –skip-grant &

mysqld_safe A mysqld process already exists

$ sudo killall mysqld mysqld_safe

mysqld_safe Directory ‘/var/run/mysqld’ for UNIX socket file don’t exists.

$ sudo /usr/bin/mysqld_safe –skip-grant &

mysqld_safe Directory ‘/var/run/mysqld’ for UNIX socket file don’t exists.

Solution

$ sudo killall mysqld mysqld_safe

$ sudo mkdir -p /var/run/mysqld

$ sudo chown mysql:mysql /var/run/mysqld

$ sudo /usr/bin/mysqld_safe --skip-grant &

$ sudo /usr/bin/mysqld_safe --skip-grant-tables &

$ mysql -u root

 

Advertisements

Author:

HOiT Creator

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s