I haven't used mysql on my computer for a long time and I have forgotten my password. But it doesn't matter, we can reset our password The principle is to open the MySQL service in a safe way and then update the table storing the password. First we need to shut down the original MySQL service, System Preferences->MySQL->Stop MySQL Server Then open a Terminal, open mysql in safe mode, and no password is required when connecting Then open another Terminal and update the password mysql -u root UPDATE mysql.user SET authentication_string=PASSWORD('your_new_password') WHERE User='root'; FLUSH PRIVILEGES; In the above format, you only need to modify your_new_password If the Mysql version is before V5.7.9, please use the following sql statement Finally restart Mysql and give it a try Mission accomplished! ! ! ! In addition, here is the solution provided by netizens: step1: Shut down the MySQL service: Apple->System Preferences->Click MySQL at the bottom. In the pop-up page, shut down the MySQL service (click Stop MySQL Server). step2: Enter the terminal and type: step3: Enter the command ./mysql After completing the above steps, the password has been changed successfully. Now you can use the newly set password to log in to MySQL. You may also be interested in:
|
<<: 15 Vim quick reference tables to help you increase your efficiency by N times
>>: Native js drag and drop function to create a slider example code
1. Check Linux disk status df -lh The lsblk comma...
Now that we have finished the transform course, l...
MySQL binary installation method Download mysql h...
Anyone who has read my articles recently knows th...
When developing a website function, the session c...
Preface This article analyzes the process of shut...
System environment: centos7.4 1. Check whether th...
The version of vsCode has been updated in recent ...
Preface About the performance comparison between ...
This article shares the specific code of jQuery t...
Table of contents Tutorial Series 1. Backup strat...
Environment Preparation 1. Environment Constructi...
Table of contents 1. Background 2. Local custom i...
Preface There are many open source monitoring too...
When making a web page, we usually need to consid...