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

Graphical explanation of the underlying principle of JavaScript scope chain

Table of contents Preface Scope 1. What is scope?...

How to use CSS styles and selectors

Three ways to use CSS in HTML: 1. Inline style: s...

MySQL 5.7.19 (tar.gz) installation graphic tutorial under Linux

The first tutorial for installing MySQL-5.7.19 ve...

Example of utf8mb4 collation in MySQL

Common utf8mb4 sorting rules in MySQL are: utf8mb...

A brief discussion on MySQL B-tree index and index optimization summary

MySQL's MyISAM and InnoDB engines both use B+...

MySQL Server IO 100% Analysis and Optimization Solution

Preface During the stress test, if the most direc...

A brief discussion on why daemon off is used when running nginx in docker

I'm very happy. When encountering this proble...

Vue implements the full selection function

This article example shares the specific code of ...

Detailed explanation of built-in methods of javascript array

Table of contents 1. Array.at() 2. Array.copyWith...

Comprehensive summary of Vue3.0's various listening methods

Table of contents Listener 1.watchEffect 2.watch ...

MySQL 8.0.15 installation tutorial for Windows 64-bit

First go to the official website to download and ...

Use of provide and inject in Vue3

1. Explanation of provide and inject Provide and ...