1. Uninstall the old version of MySQL
Go to the Mac terminal, enter a command to uninstall
CD ~/sudo RM/usr/local/MySQLsudo RM-rf/usr/local/var/MySQLsudo RM-rf/usr/local/mysql*sudo RM-rf/library/startupitems/mysqlcomsudo RM-rf/library/preferencepanes/my*Vim/etc/hostconfig and removed the line mysqlcom=-yes-RM-RF ~/library/preferencepanes/my*sudo RM-rf/library/receipts/mysql*sudo RM-rf/library/receipts/mysql*sudo RM-rf/var/db/receipts/com.mysql.*
2. After uninstalling, download MySQL version 5.7, after installation there is a default password prompt, you need to remember this password
A temporary password is generated for [email protected]: upauvqbjb7%0
If you lose this password, please consult the sections how to Reset the Root password in the MySQL reference manual.
The default path for installation is:/usr/local/mysql-5.7.16-osx10.11-x86_64
3. Login:
3.1 Turn on MySQL in System Preferences first
3.2 Entering the terminal input
Mysqladmin-u root-p password prompt for default password
Then ask to set a new password and confirm that
3.3 After setting OK, enter mysql-uroot-p
After you enter the new password, the success
4 commands
sudo root access, no need to log on to the root account can be done system configuration is quick and easy
chmod File/directory permission settings command
It is used to change the access rights of a file or directory. There are two ways to use this command:
Readable Yes Yes
Executable
chmod 664 A.txt
Refer to Other: http://xiaorui.cc/2016/01/20/mac%E4%B8%8B%E5%AE%89%E8%A3%85mysql5-7%E9%81%87%E5%88%B0%E9%BB%98%E8%AE%A4% e5%af%86%e7%a0%81%e7%9a%84%e5%a4%a7%e5%9d%91/
Install MySQL under Mac 5.7