Can't login with Mysql root account but can login when use sudo command in ubuntu 16.04 -


can't login mysql root account can login when use sudo command in ubuntu 16.04

bluebird:~$ mysql -u root -p enter password:  error 1698 (28000): access denied user 'root'@'localhost' bluebird:~$ mysql -u root -p enter password:  error 1698 (28000): access denied user 'root'@'localhost' bluebird:~$ sudo mysql -uroot [sudo] password bluebird:  welcome mysql monitor.  commands end ; or \g. mysql connection id 21 server version: 5.7.13-0ubuntu0.16.04.2 (ubuntu)  copyright (c) 2000, 2016, oracle and/or affiliates. rights reserved.  oracle registered trademark of oracle corporation and/or affiliates. other names may trademarks of respective owners.  type 'help;' or '\h' help. type '\c' clear current input statement.  mysql>  

when use mysql -u root -p, can't login. when use sudo mysql -u root, can.

and don't have password root user of mysql.

i don't know why.

i used command below:

use mysql; select user, host user; 

it turns out, somehow got 'root'@'xxxxx-aspire','root'@'localhost' , 'root'@'%'.

when delete 'root'@'xxxxx-aspire', can login mysql -uroot without problem.


Comments