What to do if you forget the initial password of MySQL on MAC

What to do if you forget the initial password of MySQL on MAC

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

first step:

Click System Preferences -> MySQL at the bottom, and in the pop-up page, turn off the service

Step 2:
Enter the terminal and enter: cd /usr/local/mysql/bin/
After pressing Enter, log in with administrator privileges sudo su
After pressing Enter, enter the following command to disable the mysql authentication function./mysqld_safe --skip-grant-tables &
After pressing Enter, MySQL will automatically restart (the status of MySQL in the preferences will become 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');


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:
  • Solution to forgetting the root password of mysql under windows
  • How to view or modify the root password of MySQL if it is forgotten (with pictures and text)
  • How to forget the root password in MySQL 5.7 and change the root password in MySQL 5.7
  • The perfect solution for forgetting the root password of Mysql
  • How to recover MySQL password if you forget it
  • Detailed method for forgetting the root password or resetting the password in Mysql 5.7
  • How to reset the MySQL password after forgetting it in Mac operating system
  • Mysql forget the root password and change the root password solution (summary)
  • The best solution to forgetting mysql password
  • How to change the password after forgetting the mysql password (2022 latest version detailed tutorial nanny level)

<<:  Vue implements the frame rate playback of the carousel

>>:  Solve the problem of docker pull being reset

Recommend

N ways to achieve two-column layout with CSS

1. What is a two-column layout? There are two typ...

HTML table markup tutorial (15): table title

<br />This tag can be used to directly add a...

How to implement h5 input box prompt + normal text box prompt

XML/HTML CodeCopy content to clipboard < input...

CSS3 clear float method example

1. Purpose Through this article, everyone can und...

JavaScript history object explained

Table of contents 1. Route navigation 2. History ...

js to achieve a simple carousel effect

This article shares the specific code of js to ac...

MySQL 5.7.25 installation and configuration method graphic tutorial

There are two types of MySQL installation files, ...

Detailed explanation of Vue save automatic formatting line break

I searched for many ways to change it online but ...

Solution to MySQL unable to read table error (MySQL 1018 error)

1. Error reproduction I can access the MySQL data...

MySQL multi-instance configuration application scenario

Table of contents MySQL multiple instances Multi-...

Detailed Tutorial on Installing MySQL 5.7 on RedHat 6.5

RedHat6.5 installation MySQL5.7 tutorial sharing,...

Example code for implementing dynamic column filtering in vue+element table

Requirement: When displaying data in a list, ther...

In-depth explanation of various binary object relationships in JavaScript

Table of contents Preface Relationships between v...