Download website
https://www.mysql.com/
Click: Downloads>community>mysql Community Server,
Image.png
Image.png
Download the 64-bit zip package to
Installation
1. Extract MySQL to the folder you want to install
2. Configure Environment variables
Add a system environment variable,
Image.png
Add:%mysql_home%\bin in Path, notice that the ";" Symbol between different values in path cannot be saved
3. Prepare the My.ini file, you can create a new My.txt file, and then rename the modified file suffix to. ini, the previous version may exist after decompression My-default.ini file, but 5.7.21 version is not, so you manually created the file, the contents of the file are as follows:
3306 basedir=c:/software/mysql-5.7. -winx64datadir=c:/software/mysql-5.7. -winx64/data max_connections=character-set-server= UTF8default-storage-engine=innodbsql_mode=No_engine_substitution,strict_trans _tables[mysql]default-character-set=utf8
This step to note: The red box is the MySQL installation path, and the folder with "/" instead of "\", or in the following operation may be an error
After editing the My.ini file, place the My.ini file in the C:\software\mysql-5.7.21-winx64 directory.
4. Open the CMD Command window as an administrator and switch the directory to the bin directory of the MySQL installation directory
Image.png
5. Execute the following command to install MySQL
Mysqld-install
Prompt after executing the command: Service successfully installed. Indicates successful installation
6. Execute the following command to initialize MySQL
Mysqld--initialize-insecure--user=mysql
After executing the command, the data directory is generated in the MySQL installation directory and the root user is created.
Image.png
7. Execute the following command to start the MySQL service
net start MySQL
After execution, you will be prompted with the following:
The MySQL service is starting:
MySQL Service has started successfully
8, after starting MySQL, the root user password is empty, set the password, the command is as follows:
mysqladmin-u root-p Password New password
Enter Password: old password
You need to enter the old password, because the old password is empty, so you can directly enter.
Download and installation of MySQL