The solution to forgetting the initial password of MySQL under MAC is shared with you for your reference. The specific content is as follows After installing the MySQL dmg from the official website. 1 Set up mysql command From the terminal, type mysql --version If the version number is displayed, it is normal; if it shows command not found, follow the code below to link the installation path cd /usr/local/bin/ sudo ln -fs /usr/local/mysql/bin/mysql mysql 2. Shut down the mysql service sudo /usr/local/mysql/support-files/mysql.server stop 3 Start mysql in safe mode sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables Then open the system preferences, select mysql, and you will find the mysql service and restart it. 4 Return to the terminal Command + N to reopen a terminal and enter mysql -u root At this time, you can directly enter mysql without a password, and you can modify any password. 5 Change the password in the new terminal mysql> FLUSH PRIVILEGES; mysql> SET PASSWORD FOR root@'localhost' = PASSWORD('123'); // You can also modify other passwords // Finally refresh mysql> FLUSH PRIVILEGES; After that, you can log in to mysql with the new password. For more information about MySQL password operations, please refer to the topic: MySQL password operations summary for learning. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Vue implements the shake function (compatible with ios13.3 and above)
>>: How to handle images in Vue forms
My first server program I'm currently learnin...
This article uses a jQuery plug-in to create an a...
To beautify the table, you can set different bord...
Strictly speaking, nginx does not have a health c...
Table of contents 1. Problem scenario 2. Cause An...
Today I looked at some things related to data bac...
Table of contents need: Main points: According to...
1. Common MySQL configuration All the following c...
Generally speaking, we can have the following two...
What we are simulating now is a master-slave syst...
To replace a string, we need to use the following...
1. Docker network management 1. Docker container ...
HTML5 adds a native placeholder attribute for inp...
In the previous article "Understanding UID a...
Table of contents 1- Error details 2-Single Solut...