My mysql version is MYSQL V5.7.9, please use the older version: UPDATE mysql.user SET Password=PASSWORD('new password') WHERE User='root'; Mac OS X - Reset MySQL Root Password Too many passwords to remember? ? Have you forgotten your MySQL root password for Mac OS? Follow these 4 steps to reset your password: 1. Stop mysql server. Usually in 'System Preferences' > MySQL > 'Stop MySQL Server' 2. Open the terminal and enter: sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables 3. Open another new terminal and enter: sudo /usr/local/mysql/bin/mysql -u root UPDATE mysql.user SET authentication_string=PASSWORD('your new password') WHERE User='root'; FLUSH PRIVILEGES; exit 4. Restart MySQL. Okay, that's it. Knowledge points supplement Windows: 1. Log in to the system as a system administrator. 2. Open cmd-----net start to check whether mysql is started. If started, stop it with net stop mysql. 3. My mysql is installed in d:\usr\local\mysql4\bin. 4. Skip the permission check and start mysql.
5. Reopen cmd. Go to d:\usr\local\mysql4\bin:
6. In cmd, net start mysql 7. Done. Linux: One of the methods to recover MySQL root password If you forget the MySQL root password, you can reset it using the following method: 1.KILL the MySQL process in the system;
2. Start MySQL with the following command without checking permissions; 3. Then log in to MySQL as root user with an empty password;
4. Change the root user's password; MySQL> update MySQL.user set password=PASSWORD('new password') where User='root'; MySQL> flush privileges; MySQL> quit Restart MySQL and you can log in using the new password. This is the end of this article about the easiest way to reset the mysql root password. For more information about how to reset the mysql root password under mysql, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Example of how to build a Harbor public repository with Docker
>>: Detailed explanation of Nginx status monitoring and log analysis
serializable serialization (no problem) Transacti...
Although I have run some projects in Docker envir...
This article shares the specific code of the WeCh...
Better-scroll scrolling principle As a parent con...
This article shares the specific code for impleme...
Table of contents How to create a Pod? kubectl to...
Table of contents 1. What are microtasks? 2. What...
Table of contents chmod Example Special attention...
1. In the previous chapter, we learned that we ca...
Requirement: When displaying data in a list, ther...
Today we are going to make origami airplanes (the...
Problem description (environment: windows7, MySql...
Environmental preparation: Deploy lnmp on a host ...
Docker is becoming more and more popular. It can ...
Download link: Operating Environment CentOS 7.6 i...