MySQL Mac Installation Guide

First go to the mysql official website and download the DMG format.

https://dev.mysql.com/downloads/mysql/

After downloading, install and configure environment variables:

Open System Preferences ➡️mysql➡️start server

Open a terminal and type

cd ~
touch .bash_profile
open -e .bash_profile

A file will be opened automatically, paste the following code

export PATH=${PATH}:/usr/local/mysql/bin

Save, type ⬇️ in the terminal to run the modification

source ~/.bash_profile

log in later

mysql -u root -p

Enter the password to connect.

Thanks to these two articles here:

https://zhuanlan.zhihu.com/p/27960044

https://blog.csdn.net/WinstonLau/article/details/81323340

After that, an error of 1251 appeared:

Can use the following methods to solve:

USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
FLUSH PRIVILEGES;

https://blog.csdn.net/u013700358/article/details/80306560

Guess you like

Origin blog.csdn.net/Stark6/article/details/104083370