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

MySQL optimization solution: enable slow query log

Table of contents Preface Setting up slow query l...

Box-shadow and drop-shadow to achieve irregular projection example code

When we want to add a shadow to a rectangle or ot...

Essential knowledge for web development interviews and written tests (must read)

The difference between inline elements and block-...

How to configure MySQL master-slave replication under Windows

MySQL master-slave replication allows data from o...

Detailed explanation of various join summaries of SQL

SQL Left Join, Right Join, Inner Join, and Natura...

You may need a large-screen digital scrolling effect like this

The large-screen digital scrolling effect comes f...

The whole process of implementing the summary pop-up window with Vue+Element UI

Scenario: An inspection document has n inspection...

Detailed explanation of JavaScript timers

Table of contents Brief Introduction setInterval ...

JavaScript implements double-ended queue

This article example shares the specific code of ...

Making a simple game engine with React Native

Table of contents Introduction Get started A brie...

Steps to install Pyenv under Deepin

Preface In the past, I always switched Python ver...

Front-end development must learn to understand HTML tags every day (1)

2.1 Semanticization makes your web pages better u...