MySQL initialization password operation under Mac

MySQL initialization password operation under Mac

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

1. Apple->System Preferences->Click MySQL at the bottom. In the pop-up page, turn off the MySQL service (click Stop MySQL Server)

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)

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('你的新密碼');

The above is the MySQL initialization password operation under Mac introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Steps to initialize the password after the first successful installation of MySQL

<<:  How to install JDK8 on Windows

>>:  Node.js file copying, folder creation and other related operations

Recommend

Summary of the differences between get and post requests in Vue

The operating environment of this tutorial: Windo...

Analysis of a MySQL deadlock scenario example

Preface Recently I encountered a deadlock problem...

Listen directive example analysis in nginx

Plot Review In the previous article, we analyzed ...

What does the legendary VUE syntax sugar do?

Table of contents 1. What is syntactic sugar? 2. ...

How to use glog log library in Linux environment

Generate Linux library The Linux version uses cen...

Detailed explanation of MySQL covering index

concept If the index contains all the data that m...

Implementation of importing and exporting vue-element-admin projects

vue-element-admin import component encapsulation ...

The difference between HTML name id and class_PowerNode Java Academy

name Specify a name for the tag. Format <input...

MySQL slow query optimization: the advantages of limit from theory and practice

Many times, we expect the query result to be at m...

Linux unlink function and how to delete files

1. unlink function For hard links, unlink is used...

Implementation steps for docker deployment lnmp-wordpress

Table of contents 1. Experimental Environment 2. ...

HTML+CSS to achieve simple navigation bar function

Without further ado, I'll go straight to the ...

How to move mysql5.7.19 data storage location in Centos7

Scenario: As the amount of data increases, the di...