Complete steps for installing mysql5.7 on Mac (graphic explanation) and macmysql5.7

Source: Internet
Author: User
Tags mysql commands

Complete steps for installing mysql5.7 on Mac (graphic explanation) and macmysql5.7

Recently, I used the Mac system to build a local web server environment. Because the Mac system comes with PHP and apach, but does not have mysql, you must install mysql manually. The latest version of mysql is 5.7.17.

1. Download from the official website

MySQL v5.7 official version: http://www.bkjia.com/softs/451120.html

Click the address above to see the page shown in figure. You may not know which one to download. I downloaded the last one, which is the red button in the figure. Why? Because it is a dmg file, it can be installed in a silly way and confirmed all the way.

After clicking in, you will see two big buttons, login and registration. If you don't want to do these tedious operations, don't worry. Read the text in the red circle and click it to download it directly. (For the first time, I didn't know how to register this trap)

2. Install mysql

After the download is complete, click Install to confirm all the way, and wait until the installation is successful.

Start mysql

Go to system preference settings, click the bottom line, find mysql to open, click "Start MySQL Server", Start mysql

Run the command line

Find the iTerm option in the application and run the following two commands:

alias mysql=/usr/local/mysql/bin/mysqlalias mysqladmin=/usr/local/mysql/bin/mysqladmin

These two commands allow you to run mysql commands simply by enabling iTerm, instead of entering the mysql installation directory. Next, you need to reset the password.

Reset Password command:

mysqladmin -u root -p password newpass

Newpass is your new password.

After you run the Reset Password command, the system prompts you to enter the old password. If you have installed mysql5.6 or a previous version, you will know that the first time mysql runs, a default password will be assigned to the root user: root. The old password is root. However, if you enter root, the system prompts a wrong password. What is the problem?

The original version 5.7 will not assign the default password to the root user, but will give a temporary password. If you are careful, a temporary password will pop up after the mysql installation is successful for you to save. It doesn't matter if you haven't saved it. There will be in the notification bar on the right,

 

My temporary password is _; kb8t7 =-ZoU

Enter the temporary password. The password is successfully modified, and then log on with the new password:

mysql -u root -p

Press enter, new password, press enter, login successful!

Now you can write your SQL command!

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.