1. Problem description: MysqlERROR1698 (28000) solution, newly installed mysql-server-5.7, login to this problem, ordinary users can not enter mysql, only root users can enter, and no password is required. ~$ mysql -u root -p Enter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost' Second, the 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 in without a password ~$ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.10 MySQL Community Server (GPL) Check the user table. The cause of the error is here. The root plugin has been changed to auth_socket, and the plugin for logging in with a 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) There is an official description about auth_socket: https://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/socket-authentication-plugin.html. Anyway, we won’t use it for now, so just change it 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 will be 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 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.10 MySQL Community Server (GPL) The above is the solution to the MySql Error 1698 (28000) problem introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Installation of Docker CE on Ubuntu
>>: JavaScript code to achieve a simple calendar effect
Viewing and Setting SQL Mode in MySQL MySQL can r...
Table of contents 1. exists 1.1 Description 1.2 E...
Table of contents process Demo Mini Program Backe...
Preface We all know that the import and export of...
A few days ago, a colleague received a points mal...
Table of contents Routing Manager background gett...
This article shares with you how to use Vue to ch...
Preface Js is the most commonly used code manipul...
Uninstall old versions If you have installed an o...
In daily development, database addition, deletion...
JS calculates the total price of goods in the sho...
Today, when I was looking at the laboratory proje...
The solution to the problem that Ubuntu 18.04 in ...
Table of contents npm Install the loader Import P...
In the previous article, we introduced three comm...