Installation of MySQL software:
Mysql-5.7.19-win64.zip (https://dev.mysql.com/downloads/mysql/) is now mysql-5.7.20-win64.zip.
Baidu Network Disk Link: Http://pan.baidu.com/s/1jHNVunW Password: Cvyz
Find a directory to store the installation:
My directory is: D:\SOFTWARE\MYSQL
With personal hobbies, you can find your own directory to unzip files.
The following files are extracted: ( There is no Data folder and My.ini configuration file in the extracted file )
Create a new Data folder and a My.ini configuration file in the MySQL installation root directory for initialization use.
The My.ini configuration file is as follows:
[Client]
port=3306
Default-character-set=utf8
[Mysqld]
port=3306
Character_set_server=utf8
# Set the installation directory for your MySQL
Basedir=d:\\software\\mysql
# Data Directory set to MySQL
Datadir=d:\\software\\mysql\\data
Sql_mode=no_engine_substitution,no_auto_create_user
[Winmysqladmin]
D:\\software\\mysql\\bin\\mysqld.exe
#开启查询缓存
Explicit_defaults_for_timestamp=true
# Skip-grant-tables
Run the Command Line window as an administrator and switch to the bin directory of the MYSQL installation path, which is D:\software\MySql\bin
Enter the mysqld--install command to add MySQL to the local service
D:\software\mysql\bin> mysqld--install
Then perform the initialization: mysqld--defaults-file=:D: \software\mysql\my.ini--initialize (note--defaults-file as the newly created My.ini file, Using the--initialize parameter, the MySQL service generates a random password display, remember this password, and here you can also use the--initialize-insecure parameter, the MySQL service does not generate an initialization password, That is, Root does not need to enter the password to log in the initial connection)
D:\software\mysql\bin> mysqld--defaults-file=:D: \software\mysql\my.ini--initialize
Start MySQL service d:\software\mysql\bin>net start MySQL
Connect to MYSQL service D:\software\mysql\bin>mysql-u root-p
Enter Password:_(enter a random password here or empty)
Set a new password for the root user: Select the system's built-in database named MySQL, update the user table root password, such as password V!tpzp6n?ko), and finally refresh the permissions related table, so that the update takes effect
mysql> use MySQL;
mysql> Update user Set authentication_string = password (' V!tpzp6n?ko) ') where user = ' root ';
mysql> flush Privileges;
Windows Decompression Edition installs 64-bit mysql-5.7.19