MySql Error 1698 (28000) solution, 169828000
I. Problem description:
MysqlERROR1698 (28000) solution, the new installed mysql-server-5.7, login for this problem, ordinary users can not enter mysql, only root users can enter, and do not need any password.
~$ mysql -u root -pEnter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost'
2. Solution steps:
Stop mysql Service
~$ sudo service mysql stop
Start MySQL in Safe Mode
~$ sudo mysqld_safe --skip-grant-tables &
After MySQL is started, you can log on without a password.
~$ mysql -u rootWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.10 MySQL Community Server (GPL)
Check the user table. The cause of the error is that the root plug-in is modified to auth_socket. The plug-in that logs in with the password should be mysql_native_password.
mysql> select user, plugin from mysql.user;+-----------+-----------------------+| user | plugin |+-----------+-----------------------+| root | auth_socket || mysql.sys | mysql_native_password || dev | mysql_native_password |+-----------+-----------------------+<strong>3</strong> rows in set (<strong>0.01</strong> sec)
About auth_socket, There are instructions in the official: https://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/socket-authentication-plugin.html, anyway, now do not use it, it will change here.
mysql> update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';Query OK, <strong>1</strong> row affected, <strong>1</strong> warning (<strong>0.00</strong> sec)Rows matched: <strong>1</strong> Changed: <strong>1</strong> Warnings: <strong>1</strong>mysql> flush privileges;Query OK, <strong>0</strong> rows affected (<strong>0.00</strong> sec)
Restart the service and the problem is solved.
~$ sudo service mysql stop... * MySQL Community Server 5.7.10 is stopped~$ sudo service mysql start.. * MySQL Community Server 5.7.10 is started~$ mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.10 MySQL Community Server (GPL)
The above section describes how to solve the MySql Error 1698 (28000) problem. I hope it will be helpful to you. If you have any questions, please leave a message for me, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!