MySQL 5.7.20 installation and configuration method graphic tutorial, share with you 1. Official website: https://dev.mysql.com/downloads/mysql/Download It is strongly recommended to download the dmg file. After downloading the tar version and unzipping it, you need to move the folder to the default installation location /usr/local. It also requires various configurations, which is really troublesome~ 2. Double-click the pkg file to install it, and continue until the following interface pops up: The part in the red box in the figure is the initial password after MySQL installation, please remember 3. Open the system "Preferences" and click the MySQL icon below Enter the mysql console, where you can start or stop the mysql server 4. Environment Setup Open the terminal, enter the MySQL installation directory /usr/local/mysql, enter the bin directory, and execute the mysql -u root -p login statement. The system prompts the error "-bash:mysql:command not found". The reason is that when executing the command, the system will actively search for the command under the environment variable $PATH. If the command is not found, it will prompt that it does not exist. Because we did not configure MySQL after installing MySQL, the system cannot find the mysql command. Edit the file, vim ~/.bash_profile and add the MYSQL_PATH environment variable: #mysql export PATH=${PATH}:/usr/local/mysql/bin Type source ~/.bash_profile to make the file take effect immediately. 5. Reset Password Enter the bin file and enter the new password in the terminal. The password here is the password automatically generated by the system that you remembered before. Then use mysql -u root -p to log in to mysql. 6. Aliases In order to improve work efficiency, it is obviously troublesome to enter mysql in the bin file every time. For this reason, we need to define an alias so that no matter where you are, you can directly call the mysql and mysqkadmin commands. Terminal input: alias mysql=/usr/local/mysql/bin/mysql alias mysqladmin=/usr/local/mysql/bin/mysqladmin Wonderful topic sharing: MySQL different versions installation tutorial MySQL 5.6 installation tutorials for various versions MySQL 5.7 installation tutorials for various versions mysql8.0 installation tutorials for various versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Understanding Vuex in one article
>>: Using vsftp to build an FTP server under Linux (with parameter description)
Table of contents Two major categories of functio...
Note: This demo is tested in the mini program env...
Table of contents 1. What is a prototype? 1.1 Fun...
By default, the width and height of the cell are ...
Table of contents 1. Three functions of toString ...
When it comes to styling our web pages, we have t...
Dynamic rem 1. First, let’s introduce the current...
Virtualization and containerization are two inevi...
1. Use .gifs rather than .jpgs. GIFs are smaller ...
Table of contents Cause of the incident Use Node ...
Preface When operating and managing Linux servers...
Table of contents Features Advantages Installatio...
We all have files stored on our computers -- dire...
The questions encountered in Baidu interviews nee...
Now let's summarize several situations of con...