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.