SQLSTATE[HY000] [1698] Access denied for user ‘root’@’localhost’. Tried everything

Method 1:

$sudo mysql -u root
[mysql] use mysql;
[mysql] update user set plugin='' where User='root';
[mysql] flush privileges;
[mysql] \q


If Still not get Work Try this:

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD(”YOUR_PASSWORD”) where user=’root’;
mysql> flush privileges;
mysql> quit
/etc/init.d/mysql stop
/etc/init.d/mysql start


If Still not Get work Try this

sudo mkdir /var/run/mysqld; sudo chown mysql /var/run/mysqld
mysqld_safe --init-file=/home/me/mysql-init &
sudo mysqld_safe --skip-grant-tables &
sudo mysql -u root
mysql> use mysql;
mysql> update user set authentication_string=password('1234') where user='root';
mysql> update user set plugin="mysql_native_password";





Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.