Install login MySQL website
Install it in DMG mode. Download MySQL Community Server
Or regular way, open official website: http://www.mysql.com/downloads/Enter, click the Downloads:mysql Community Server below
Select DMG File Download
Select Choose not to log in, direct download
Next, will jump to the following page, you just have to choose not to login, directly download can
Remember the temporary password
When the download is complete, double-click to open it all the way, but when you pop up a MySQL installer prompt, make sure to open the memo copy and paste note the pop-up box password
2016-10-16t02:52:44.474550z 1[note] A temporary password is generated for [email protected]:/kl_m_zxd3ra.
Or just copy the cipher part./kl_m_zxd3ra Why don't you write it down? Because the password is a bit complicated and difficult to fight.
Turn on the MySQL service
Under normal circumstances, the installation is successful.
The installation was successful at this point, but additional configuration is required:
1. Enter System Preferences
2. Click MySQL
3. Turn on MySQL service
Click the button
The red part of the screen turns green when the running is turned on.
Configuration path Open the. bash_profile file with a text editor
Vim ~/.bash_profile
Join
Path= $PATH:/usr/local/mysql/bin
and save (in Vim, first press the ESC key, in the input: WQ)
At the command line, enter
SOURCE ~/.bash_profile
The path is configured.
The above scenario is based on the bash configuration method.
Use VI to modify the file, save the file, the prompt "readonly option is set" workaround.
Steps:
1. Press the ESC key
2. Input: Set noreadonly
3. Then it will be saved normally, you can enter: Wq to save the file.
Log in to MySQL at the command line input
Mysql-u root-p
Login, enter the previously saved password
The cursor does not move when you enter a password
Change Password MySQL input
' Root '@'localhost' = PASSWORD ('newpass');
If your version is newer (for example, I installed the 5.7.15 version), the following prompt will appear, this time has updated the password,
But there will be warning. If you want to see warning, you can use show warning.
Command-line Installation
At the command line, enter
Brew Install MySQL
The Brew Package management tool installs its own MySQL
Install the MySQL database on your Mac