Mysql5.7.20 installation and configuration method graphic tutorial (mac ),

Source: Internet
Author: User

Mysql5.7.20 installation and configuration method graphic tutorial (mac ),

How to install and configure mysql5.7.20

1. Official Website: https://dev.mysql.com/downloads/mysql/download

We strongly recommend that you download the dmg file. After downloading the tar version and decompressing it, you need to move the folder to the default installation location/usr/local. It is troublesome to use various configurations ~

2. Double-click the pkg file to install it. continue until the following page is displayed:

The content in the red box in the figure is the initial password after mysql is installed. Remember

3. Open "preference settings" and click the mysql icon below.

Go to the mysql console, where you can enable or disable mysql server

4. Environment Settings

Open the terminal, enter the MySQL installation directory/usr/local/mysql, enter the bin directory, and run the mysql-u root-p logon statement. The system prompts "-bash: mysql: command not found "error because the system takes the initiative to search for the command under the environment variable $ PATH when executing the command. If the command is not found, the system prompts that it does not exist, because MySQL is not configured after MySQL is installed, the mysql command cannot be found.

Edit file, vim ~ /. Add the MYSQL_PATH environment variable to bash_profile:

#mysqlexport PATH=${PATH}:/usr/local/mysql/bin

Enter source ~ /. Bash_profile to make the file take effect immediately.

5. Reset the password

Enter the binfile and terminal
Enter the new password mysqladmin-u root password
The password here is the password automatically generated by the system.
Then, use mysql-u root-p to log on to mysql.

6. Alias

To improve work efficiency, it is obviously troublesome to input mysql in the binfile every time. Therefore, we need to define aliases so that mysql and mysqkadmin commands can be directly called no matter where you are. Terminal input:

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

Highlights: mysql installation tutorials for different versions mysql5.7 installation tutorials for various versions mysql5.6 installation tutorials

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

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.