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

How to use shell to perform batch operations on multiple servers

Table of contents SSH protocol SSH Connection pro...

v-for directive in vue completes list rendering

Table of contents 1. List traversal 2. The role o...

Sample code for implementing music player with native JS

This article mainly introduces the sample code of...

Docker installation rocketMQ tutorial (most detailed)

RocketMQ is a distributed, queue-based messaging ...

How to encapsulate the carousel component in Vue3

Purpose Encapsulate the carousel component and us...

HTML sample code for implementing tab switching

Tab switching is also a common technology in proj...

Detailed explanation of the simple use of MySQL query cache

Table of contents 1. Implementation process of qu...

Vue+element+oss realizes front-end fragment upload and breakpoint resume

Pure front-end implementation:切片上傳斷點續傳.斷點續傳needs ...

How to implement hot deployment and hot start in Eclipse/tomcat

1. Hot deployment: It means redeploying the entir...

A solution to the abnormal exit of Tomcat caused by semaphore

I'm playing with big data recently. A friend ...

Detailed explanation of CSS margin overlap and solution exploration

I recently reviewed some CSS-related knowledge po...

JS function call, apply and bind super detailed method

Table of contents JS function call, apply and bin...

Detailed explanation of how Tomcat implements asynchronous Servlet

Preface Through my previous Tomcat series of arti...

WeChat applet implementation anchor positioning function example

Preface In the development of small programs, we ...