[TOC]
The installation process is very simple, just follow the installation package step by step
1⃣️Close the mysql service in the system preferences
2⃣️Enter the terminal: execute
cd /usr/local/mysql/bin/
to obtain administrator rights:
sudo su
Disable the verification function of mysql
./mysqld_safe --skip-grant-tables &
./mysql
FLUSH PRIVIEGES;
SET PASSWORD FOR 'root'@'localhost' = 'root'
Through these commands, the password of mysql default user root will be set to root
1⃣️Open ~/.bash_profile
File
2⃣️Enter
export PATH=$PATH:/usr/local/mysql/bin
in the open file to exit and save the vim editor
3⃣️Enter
source ~/.bash_profile
Execution environment variable
Now you can enter the mysql interactive interface through
mysql -u root -p
.
The above is the detailed introduction of mac installation and configuration of mysql. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!