1. Download the DMG installation file on the official website.
2. After the download is complete, run the installation file, follow the steps to install, the installation will pop up a box to show the temporary password !
3. Edit the ~/.BASHRC file, configure the Quick Start/stop/restart/cdhome/aliases:
# # MySQL [
Alias Alias-start-mysql= ' sudo/usr/local/mysql-5.7.20-macos10.12-x86_64/support-files/mysql.server start '
Alias alias-stop-mysql= ' Sudo/usr/local/mysql-5.7.20-macos10.12-x86_64/support-files/mysql.server stop '
Alias alias-restart-mysql= ' sudo/usr/local/mysql-5.7.20-macos10.12-x86_64/support-files/mysql.server restart '
# # MySQL]
# # Quick CD [
Alias Alias-cd-mysql-home= ' cd/usr/local/mysql-5.7.20-macos10.12-x86_64 '
# # Quick CD]
4. Execute: SOURCE ~/.BASHRC command to make it effective.
5. Edit the ~/.bash_profile file, configure the MySQL environment variable, and add it to path:
# # MySQL [
Export mysql_home=/usr/local/mysql-5.7.20-macos10.12-x86_64
# # MySQL]
Export path= $PATH: $M 2_home/bin: $MYSQL _home/bin
6. Repeat step 4.
7. Execute: Alias-start-mysql, enter the password of the current notebook login user .
8. Execute: Mysql-uroot-p-p3306-h127.0.0.1, enter the temporary password generated during installation .
9. Execute: SET PASSWORD = PASSWORD (' root ');
10. Execute: Quit, quit MySQL connection.
OK, execute: mysql-uroot-proot-p3306-h127.0.0.1 to see if the password was reset successfully.
Install MySQL under Mysql-mac