This article mainly introduces in detail the detailed steps of installingmysql5.7.18 under Mac. It has certain reference value. Interested friends can refer to it. Let’s take a look
1. Tools
We need two tools now: MySQL server (mysql-5.7.18), MySQL GUI (mysql-workbench)
MySQL server contains the entire operating environment of MySQL. After installing it, you can make MySQL run well through the command line.
Of course, if you don’t like the command line, you can download a GUI tool to manage MySQL. The GUI has rich functions, including permission settings, create database, create tables, etc.
2. Installation
1.MySQL server
I What I downloaded is mysql-5.7.18-macos10.12-x86_64.dmg
. After downloading, I installed it directly. I was speechless all the way.
It is worth noting: After the installation is complete, a pop-up window will prompt the root account password. Please record it and we will use it later
Installation completed Finally, the mysql command cannot be recognized in the terminal. You need to configure it
$ cd /usr/local/bin/ $ sudo ln -fs /usr/local/mysql/bin/mysql mysql $ mysql --version
# to display the mysql version description. Mysql installation is successful
Change the password of the root account:
$ sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables
$ mysql -u root
# will enter mysql command mode, line by line Enter the following command
UP DATE mysql.user SET authentication_ string =PASSW ORD ('*****') WHERE User='root'; FLUSH PRIVILEGES; \q
#Verify the password after modification
# mysql -u root -p
2. Install GUI
I downloaded mysql-workbench-community-6.3.9-osx-x86_64.dmg
Download and install, nothing to say all the way.
After installation, open Workbench, the interface is as follows:
Click to enter
root
localhost:3306
When you enter for the first time, you will be prompted to change your password, so just change it.
Enter Workbench
The installation is now complete!
The above is the detailed content of Detailed steps for installing mysql5.7.18 on Mac. For more information, please follow other related articles on the PHP Chinese website!