Graph tutorial on installing and configuring mysql 5.7.13 on Mac, mysql5.7.13

Source: Internet
Author: User

Graph tutorial on installing and configuring mysql 5.7.13 on Mac, mysql5.7.13

The installation tutorial for mysql 5.7.13 on Mac is detailed. The record is as follows:

First, download the installation package from Baidu mysql.

In this case, the installation using the command line may cause various problems. In addition, you can directly download the DMG installation package (Ps: it is recommended that you use thunder to download files directly. The download speed will not be slow because of the network speed problem. The normal download speed is almost two minutes)

1. Installation packages downloaded from the official website:Start the next step. After installation is complete

Remember passwordThis is used to change the password.

Turn on the system preference settings and you will find that there is a mysql icon at the bottom.

This means that the installation is successful. Click start Mysql to start the Mysql instance. If there is no response, restart the instance directly. You don't have to worry about it, at last, you can restart the Mysql instance to automatically start the service.

At this time, if you execute the command line directly, a prompt will be displayed.

$ mysql -bash: mysql: command not found

At this time, we need to add mysql to the environment variable:

Run vim ~ /. Bash_profile: add the mysql/bin directory to the file. For details, see pic7: PATH = $ PATH:/usr/local/mysql/bin. After adding the directory, Press esc and enter wq to save the file. Finally, enter source ~ in the command line ~ The path above/. bash_profile is your/usr/local/mysql folder, which may be the same as the downloaded name.

Ps: in vim, in the edit mode, press

Then you have installed mysql.

2. Use the command line downloaded from Baidu to install

First, decompress the package you downloaded.

Change the first one to mysql (just for convenience) and move it to/usr/local /.

Log on to the/bin/folder on the console.

Mysqld -- initialize -- user = 'your username'

After the installation is complete, you will be given a string of passwords. Remember, you will need to change the password later.

Install the preceding steps to configure Environment Variables

At this time, when you open mysql in the command line, you will find that it will prompt an error. You don't need to worry about it, but it is a hard task to restart directly.

Then you can use mysql.

3. Change the root user password.

The initial password is smelly and long. You must change the password you want.

prodeMacBook-Pro:local pro$ mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 86Server version: 5.7.17 MySQL Community Server (GPL)mysql> SET PASSWORD = PASSWORD('123456');Query OK, 0 rows affected (0.03 sec)

Work done, close the work, the official provides a graphical management interface, workbench to go to the official website, the use of thunder is still very fast.

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.