Home  >  Article  >  Database  >  Detailed introduction to the installation and configuration method of mysql 5.7.13 under Mac

Detailed introduction to the installation and configuration method of mysql 5.7.13 under Mac

黄舟
黄舟Original
2018-05-26 10:53:212297browse

This article mainly introduces the graphic tutorial of mysql 5.7.13 Installation configuration method under Mac. The content is very detailed and has certain reference value. Interested friends You can refer to the

mysql 5.7.13 installation tutorial under Mac, which is very detailed and recorded as follows

First download the installation package. If you are not afraid of trouble, you can directly download mysql from Baidu

Detailed introduction to the installation and configuration method of mysql 5.7.13 under Mac

This kind of installation requires using the command line, which may cause various problems. Alternatively, you can go directly to the official website to download the installation package in DMG format (Ps: It is best to download directly using Thunder to avoid network speed problems. The download is extremely slow and the speed is almost the same as the normal download speed. I only took two minutes)

1. Installation package downloaded from the official website: Just open it all the way and take the next step. After the installation is completed

Detailed introduction to the installation and configuration method of mysql 5.7.13 under Mac

Remember the password You will need this to change the password

Open the system preferences and you will find that there are more at the bottom A mysql icon

Detailed introduction to the installation and configuration method of mysql 5.7.13 under Mac

This means that the installation is successful. Click it and click start. Mysql will start. If there is no response, just restart it. No need to bother, you will find that the After half a day, it was finally solved with a restart. After restarting, you will find that your Mysql automatically starts serving.

At this time, if you execute it directly from the command line, you will definitely be prompted. We need to add mysql to the environment

variable

:

$ mysql
 -bash: mysql: command not found
Ps: To enter

edit mode

in vim, press i and then you Mysql is installed

2. Use the command line downloaded from Baidu to install

First unzip the package you downloaded and it should look like this

Detailed introduction to the installation and configuration method of mysql 5.7.13 under MacRename the first one to mysql (just for convenience) and then move it to /usr/local/

Enter the /bin/ folder in the console

执行vim ~/.bash_profile
  在该文件中添加mysql/bin的目录,见pic7:
  PATH=$PATH:/usr/local/mysql/bin  
添加完成后,按esc,然后输入wq保存。
最后在命令行输入source ~/.bash_profile
上面的路径是你 /usr/local/下的mysql文件夹可能会和下载的名字一样 自己进去看看

Then wait for a while and the installation will be completed. Finally, you will be given a string of passwords. Remember, to change the password later, you must use the

installation and the previous steps to configure the environment variables

At this time, if you open mysql on the command line, you will find that it will prompt an error. Don't worry about it and it will be a waste of time. Just restart it.

Then your mysql will be usable.

3. Change it Root user password

The initial password is smelly and long, so be sure to change it to what you want.

mysqld --initialize --user=‘你的用户名'

Get it done and call it a day. The official provides a graphical management interface. You can go to the official website for workbench yourself. Using Thunder is still very fast.

The above is the detailed content of Detailed introduction to the installation and configuration method of mysql 5.7.13 under Mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn