Download MySQL for mac:https://downloads.mysql.com/archives/community/
Note: I downloaded the community version, and the MySQL version is consistent with your Mac version. Of course, if you have previously installed other MySQL versions, be sure to uninstall them first.
Double-click MYSQL-8.0.0-DMR-OSX10.11-X86_64.DMG to unzip and install.
Continue, Continue, Agree, Install. Record the password in the pop-up window.
Go to System Preferences, find MySQL, start the service
Add MySQL commands to the system
(1). Go to/usr/local/mysql/bin to see if there is MySQL in this directory
(2). Perform Vim ~/.bash_profile
Add the Mysql/bin directory to the file
Path= $PATH:/usr/local/mysql/bin
When you are finished adding, press ESC, and then enter Wq save.
(3). Finally enter source ~/.bash_profile on the command line
Log in to MySQL via Mysql-uroot-p and enter the previously saved password
- Reset MySQL initial password:
SET PASSWORD for ' root ' @ ' localhost ' = PASSWORD (' NewPassword ');
Reference:
1,54915916
2,https://www.cnblogs.com/yangjig/p/6014198.html
Install MySQL database records on Mac