When logging into MySQL with CentOS command, error 1045 (28000): access denied for user is reported root@localhost (using password: no) error resolution
1. Disable MySQL service: #/etc/RC. D/init. D/mysqld stop
2. Input command: #/mysqld_ Safe — user = MySQL — skip grant tables — skip Networking & amp;
3. Log in to the database: # MySQL – U root MySQL
4. MySQL & gt; use MySQL; the results are as follows:
database changed 5. MySQL & gt; update user set password = password (‘newpassword ‘) where user’ =’newuser ‘; the results are as follows:
query OK, 3 rows affected (0.00 sec) rows matched: 3 changed: 3 warnings: 0
MySQL & gt; flush priorities;
the results are as follows:
query OK, 0 rows affected (0.00 sec)
MySQL & gt; quit
;/etc/RC. D/init. D/MySQL D restart
MySQL – u newuser – P
Enter password:newpassword
mysql> ≪ login successful & gt;