Install the MySQL database on your Mac

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.