You know, we often need to use the MySQL database in Linux or Windows, but we often make a very low-level small error, small set also often make mistakes, suddenly forget the MySQL root password, then will bring a series of trouble, The following small series tells you how to reset root password on the Linux operating system.
Method/Step
The first step is to check whether the operating system has a MySQL database installed in the Debian operating system to check the command: dpkg--list |grep MySQL as follows:
First check whether the root user password has been forgotten, enter the command: Mysql-uroot-p the following figure:
Tragedy, the database root password forgotten, reload is not a benefit, the following small white to tell you how to skip security verification Change password, first close the process of MySQL service, the following figure:
Then start the mysql,/usr/local/mysql/bin/mysqld_safe–skip-grant-tables in an abnormal way &
The following figure:
This allows you to enter Mysql,/usr/local/mysql/bin/mysql-u root-p without a password (enter the password when required), as shown below:
Then there is the >use mysql;>update user set Password=password ("Enter a new password") where user= "root"; >flush privileges; re-kill the MySQL process. Use normal method to start MySQL, all OK, finished, the following figure:
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.