MySql Error 1698 (28000) solution, 169828000

Source: Internet
Author: User

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.