Graphic and text tutorial of mysql community server 8.0.16 installation and configuration method under Windows
Recently saw a lot of MySql related syntax, Xiaobai also want to learn some MySQL stored procedure writing, so I want to install MySQL, encountered some problems in the process, here recorded ~
Step 1: Download
First, go to the official website to download the MySQL version of the matching computer, the URL is as follows: www.mysql.com/
Then, go to the download page:
1)Go to download page
2)Find the position in the red box
3) Click to download
4)Go to the download page, find the matching version on the page, click Download
5)Download and extract: D:\Users\chen_lib\mysql-8.0.16-winx64 (here Xiaobai extract to this address)
Step 2: Configure environment variables
Name: MYSQL_HOME
Variable value: D:\Users\chen_lib\mysql-8.0.16-winx64
path: %MYSQL_HOME%\bin
Step 3: Installation
1. Generate data file
At the beginning, run cmd
Enter D:\Users\chen_lib\mysql-8.0.16-winx64\bin directory, where cd, D: cannot be followed by slash, otherwise an error will be reported.
After entering this path, execute the command mysqld --initialize-insecure --user=mysql
At this point, the data directory is generated under D:\Users\chen_lib\mysql-8.0.16-winx64 directory.
2. Startup Services:
Execute command: net start mysql Start mysql service, here I encountered an error;
Solution:
Execute the command: mysqld -install
In fact, the installation was successful here, but to test, I encountered a problem when testing here, continue to go down ~
Login mysql:(Because the password was not set before, so the password is blank, do not enter the password, just enter)
Command: mysql -u root -p
There is no connection here.
Solution:
Follow this operation to find MySQL to start
Try again: Success
Next, check the password
mysql> select host,user,authentication_string from mysql.user;
You can also modify or set the user password:
Command: update mysql.user set authentication_string=password("123456") where user="root";
To take effect, you need to type the command again: flush privileges;
Exit MySql
Command: QUIT
The above is all the content of this article, I hope to help everyone's study, but also hope that everyone a lot of support.