Solution 1:
1. Turn off MySQL
# Service Mysqld Stop
2. Blocking permissions
# Mysqld_safe--skip-grant-tables
3. Start a new terminal input
# mysql-u Root MySQL
Mysql>update Mysql.user Set Authentication_string=password (' 123456 ') where user= ' root ';
Mysql> FLUSH privileges;// Remember to say this, otherwise if you close the previous terminal, the original error will appear
mysql>exit;
Solution2:
1. Turn off MySQL
# Service Mysqld Stop
2. Blocking permissions
# Mysqld_safe--skip-grant-tables
3. Start a new terminal input
# mysql-u Root MySQL
mysql> Delete from user where user= ';
Mysql> FLUSH privileges;// Remember to say this, otherwise if you close the previous terminal, the original error will appear
Mysql> exit;
In the process of modifying the password, the situation encountered:
To view logs:
Workaround:
sudo service MySQL status
sudo service MySQL stop
If you had issue stopping then do following
Search for process:
PS aux | grep mysqld
Kill the process:
Kill-9 process_id
Now start MySQL on Safe mode with skip Grant
To troubleshoot problems encountered, continue to execute Solution1 or Solution2
ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' MySQL '