MySQL Error 1698 (28000) errors

Source: Internet
Author: User
Tags mysql in safe mode

Before the MySQL server to use the password to log on to the root account is not a problem, but today do not know because of the move, landing failed and there is this error code:

~$ mysql-u Root-1698 (28000for'root' localhost '

Steps to resolve:

Stop MySQL Service

sudo service MySQL stop

Start MySQL in safe mode

sudo mysqld_safe--skip-grant-tables &

After MySQL starts, you can log in without a password.

~$ mysql-u rootwelcome to the MySQL monitor.   ID 2  5.7.  MySQL Community Server (GPL)

Look at the user table, the cause of the error is here, the root of the plugin has been modified to auth_socket, the password to log on the plugin should be mysql_native_password.

Mysql> Select User, plugin fromMysql.User;+-----------+-----------------------+| User      |Plugin|+-----------+-----------------------+|Root|Auth_socket||Mysql.sys|Mysql_native_password||Dev|Mysql_native_password|+-----------+-----------------------+3Rowsinch Set(0.01Sec

About Auth_socket, in the official note: https://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/socket-authentication-plugin.html , but now it is not used for the time being, change it here.

Mysql> UpdateMysql.User SetAuthentication_string=PASSWORD ('newpwd'), plugin='Mysql_native_password' where User='Root'; Query OK,1Row affected,1Warning (0.00sec) Rows matched:1Changed:1Warnings:1MySQL>FlushPrivileges; Query OK,0Rows Affected (0.00Sec

Restart the service, the problem is solved

sudo5.7. Ten Is stopped sudo  5.7. Ten Is started~$ mysql-u root –penter password:welcome to the MySQL monitor.   ID 2  5.7.  MySQL Community Server (GPL)

    

MySQL Error 1698 (28000) errors

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.