Home > Database > Mysql Tutorial > Sharing the solution for forgetting the initial password of MySQL under MAC (picture)

Sharing the solution for forgetting the initial password of MySQL under MAC (picture)

黄舟
Release: 2017-03-28 13:43:48
Original
1591 people have browsed it

MySQLHow to solve the problem of forgetting the initial password. This article mainly introduces the solution to the problem of forgetting the initial password of MySQL under MAC. It has certain reference value. Interested friends can refer to it

The method to solve the problem of forgetting the initial password of MySQL under MAC is shared with everyone for your reference. The specific content is as follows

The first step:

Click on the system Preferences-> Click MySQL at the bottom, and in the pop-up page, close the service

Sharing the solution for forgetting the initial password of MySQL under MAC (picture)Sharing the solution for forgetting the initial password of MySQL under MAC (picture)

##Step 2:Enter the terminal and enter: cd /usr/local/mysql/bin/
Press Enter to log in with administrator rights sudo su
Press Enter and 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)

Step 3:Enter the command./ mysql
After pressing Enter, enter the command FLUSH PRIVILEGES;
After pressing Enter, enter the command SET PASSWORD FOR 'root'@'localhost' = PASSWORD('your new password');

Sharing the solution for forgetting the initial password of MySQL under MAC (picture)

The above is the detailed content of Sharing the solution for forgetting the initial password of MySQL under MAC (picture). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template