Home >Database >Mysql Tutorial >Detailed explanation of MySQL initialization password operation under Mac

Detailed explanation of MySQL initialization password operation under Mac

黄舟
黄舟Original
2017-03-16 13:57:411167browse

A simple record of the database startup problems encountered by individuals operating databases on Mac. Next, through this article, I will introduce you to the MySQL initialization password operation under Mac. Friends who need it can refer to

A simple record of database startup problems encountered by individuals operating databases on Mac

1. Apple -> System Preferences -> Click mysql at the bottom and close the mysql service in the pop-up page (click stop mysql server)

2. Enter the terminal and enter :cd /usr/local/mysql/bin/

After pressing Enter, log in with administrator rights sudo su

After pressing Enter, enter the following command to disable the mysql verification function. /mysqld_safe --skip-grant-tables &

After pressing Enter, mysql will automatically restart (the status of mysql in the preferences will change to running)

3. Enter Command./mysql

After pressing Enter, enter the command<a href="http://www.php.cn/wiki/563.html" target="_blank">FLUSH</a> PRIVILEGES;

After pressing Enter, enter the command<a href="http://www.php.cn/code/8209.html" target="_blank">SET</a> PASSW<a href="http://www.php.cn/wiki/1360.html" target="_blank">ORD</a> <a href="http://www.php.cn/wiki/125.html" target="_blank">FOR</a> 'root'@'localhost' = PASSWORD('your new password');

The above is the detailed content of Detailed explanation of MySQL initialization password operation under Mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn