downloads the zip installation package:

MySQL8.0 For Windows zip package download address:

or direct download: https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-winx64.zip

environment: Windows 10

1.2, the configuration file

in the Windows system, the default configuration file is the my.ini file (or my-default.ini) under the installation directory, part configuration needs to be configured in the initial installation, most can also be changed after the installation is completed. Of course, in extreme cases, everything can be changed.

we found that the decompressed directory does not have a my.ini file, and it can be created by itself. Add my.ini in the installation root directory, for example, I am here: C:Program FilesMySQLmy.ini, write the basic configuration:

 [mysqld], set the 3306 port port=3306, set the MySQL's installation directory basedir=C:Program FilesMySQL The maximum number of connections allowed by Data max_connections=200 allows the number of connections to fail. This is to prevent someone from trying to attack a database system max_connect_errors=10 with the default memory engine default-storage-engine=INNODB that will be used when the character set is used by the character set of the database server to create a new table. The default use "mysql_native_password" plug-in authentication default_auth is used by default. The default character set of the entication_plugin=mysql_native_password [mysql] client is set up by the default character set of the MySQL client, default-character-set=utf8 [client], and the default port port=3306 default-character-set=utf8

attention is used when the MySQL client is connected to the server side, and the basedir is my local installation directory, dataDir It is my database data file to store the location, the configuration needs to be configured according to its own environment.

looks at all the configuration items for reference: https://dev.mysql.com/doc/refman/8.0/en/mysqld-option-tables.html

1.3, which initializes the database

in the bin directory of the MySQL installation directory. After completion, the initial default password for root users is printed, such as:

 C:UsersAdministrator> CD C:Program FilesMySQLbin C:Program FilesMySQLbin> mysqld --initialize --console. (mysqld 8.0.11) initializing of server in progress as process 4984 2018-04-28T15:57:24.859249Z 5 [Note] [MY-010454]. .0.11) initializing of server has completed C:Program FilesMySQLbin> 

note! [Note] [MY-010454] [Server] A temporary password is generated for

if your hand is cheap, fast, or not remember, that's OK, delete the initialization of the dataDir directory, and then execute the initialization command, and will be regenerated. Of course, you can also use security tools, forcing the password to change, and use whatever method you want.

reference: https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization-mysqld.html

1.4, the installation service

executes commands under the bin directory of the MySQL installation directory (open the command line as administrator, or right key in the installation directory. " Open the command line window here "):

mysqld --install [service name]

after the service name can not be written, the default name is mysql. Of course, if you need to install multiple MySQL services on your computer, you can distinguish them with different names, such as mysql5 and mysql8. After the installation of

, you can start the service of MySQL through the command net start mysql.

example:

 C:Program FilesMySQLbin> mysqld --install Service successfully installed. C:Program. 

C:Program FilesMySQLbin>

reference: https://dev.mysql.com/doc/refman/8.0/en/windows-start-service.html

mysql -u root -p

at this time will be prompted to enter the password, remember the password at the above 1.3 step installation, fill in the login success, into the MySQL command mode.

executes

 SET PASSWORD=PASSWORD ('[modified password]') before MySQL8.0.4; 

can change the password, but MySQL8.0.4 begins, so default is not possible. Because before, MySQL's password authentication plug-in is "mysql_native_password", and now it uses "caching_sha2_password".

does not support "caching_sha2_password" because many database tools and links are currently not supported. For the convenience, I have changed back to the "mysql_native_password" authentication plug-in for the time being.

modifies the user password and executes the commands in MySQL:

 ALTER USER'root'@'localhost'IDENTIFIED WITH mysql_native_password BY' new password '; modify the password authentication plug-in and modify the password. 

can configure the default_authentication_plugin item in the configuration file if you want to default using the "mysql_native_password" plug-in authentication.

 [mysqld] default_authentication_plugin=mysql_native_password

example:

 C:Program FilesMySQLbin> MySQL -u root. Ght (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a. ER USER'root'@'localhost'IDENTIFIED WITH mysql_native_password BY' new password '; Query OK, 0 rows affected (0.06 sec). In this case, the installation and deployment will be completed. The official says the test speed is MySQL8 two times faster than 5. 

can use commands to view the default installed database:

 show databases, use mysql, show tables, mysql>, show, and +. - + 4 rows in set (0.01 sec) mysql> 

sees the default initialization of MySQL database, where MySQL table stores MySQL user information. We can look at the default MySQL users:

 select user, host, authentication_string from mysql.user; mysql> select user. There is a + - -- + - -- + - -- + - -- + - -- + localhost, *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE, mysql.session, mysql.sys, localhost, *THISISNOTAVALIDPASSWORDTHAT, localhost, *THISISNOTAVALIDPASSWORDTHAT, mysql.sys CANBEUSEDHERE root localhost *27C237A977F4F44D3F551F1A673BE14DFD232961 + - -- + - - + - -- + - -- + 4 rows in set (0 sec) mysql> 

administrator root. If you want to allow other IP login to be opened, you need to add a new host. If you want to allow all IP access, you can directly modify it to "%"

to create users:

 CREATE USER'xxh'@'%'IDENTIFIED WITH mysql_native_password BY! Quan Yuancheng database delegate all rights GRANT ALL PRIVILEGES ON *. *. *. * TO'xxh'@'%'; the authorized basic query modification permissions, GRANT SELECT, INSERT, UPDATE, DELETE, CREATE. 

 mysql> use MySQL; Database changed mysql> CREATE USER'xxh'@'%'IDENTIFIED. Select user, host, plugin, authentication_string from user, +, +, +, +, +, +, +, +, +, user, plugin, authentication_string, plugin, authentication_string, + - + - + - + - -- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + - ---- + + - ---- Xxh, mysql.infoschema, localhost, mysql_native_password, *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE, mysql.session, localhost, mysql.session, localhost, mysql_native_password, *THISISNOTAVALI DPASSWORDTHATCANBEUSEDHERE, mysql_native_password, *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE, root, localhost, mysql_native_password, *27C237A977F4F44D3F551F1A673BE14DFD232961, *27C237A977F4F44D3F551F1A673BE14DFD232961, and *27C237A977F4F44D3F551F1A673BE14DFD232961. - - + 5 rows in set (0 sec) mysql> 

, if necessary


This concludes the body part