Window10 MYSQL database installation details

1, download the installation package.

Download: https: //dev.mysql.com/downloads/mysql/

 

 

After clicking the download, Oracle may choose to register an account, you can skip directly to the download.

After the download is complete, select and extract placed within a disk.

 

2 Installation Tutorial

(1) configuration environment variable

Variable name: MYSQL_HOME

Variable values: E: \ mysql-5.7.20-winx64

 

(2) generating a data file

Run as administrator cmd

Enter E: \ python \ mysql \ mysql -8.0.12-winx64 \ bin> ( Note: This is your own to put the directory)

Run: mysqld --initialize-insecure --user = mysql, aimed at E: \ python \ mysql \ mysql-8.0.12-winx64 \ bin directory data directory generated

 

(3) Installation MySQL (MySQL install Windows Services)

Continue to execute the command: mysqld -install

 

(4) to start the service

Continue to execute the command: net start MySQL

关闭MySQL服务:  net stop mysql

 

(5) Log in MySQL

Log mysql :( because no password before, so the password is blank, no password, you can directly enter)

E:\python\mysql\mysql-8.0.12-winx64\bin>mysql -u root -p

 

(6) to query the user password

Query User Password command: mysql> select host, user, authentication_string from mysql.user;

 

(7) provided (or modify) the root user password

 

7.1 connection permissions database: mysql> use mysql; 

 

7.2 mysql> update mysql.user set authentication_string = password ( "123456") where user = "root"; #password ( "123456"), the contents of the quotes here is the password, they can easily set (note the statement points behind number should)

The following code illustrates setting success prompted:   

    Query OK, 1 row affected, 1 warning (0.00 sec)

      Rows matched: 1  Changed: 1  Warnings: 1

7.3 mysql> flush privileges; # effect: the equivalent of saving, after executing this command, set to take effect, if not implemented, or before the password change (note statement after the semicolon should be)

The following code illustrates prompt appears to save passwords successfully: 

    Query OK, 0 rows affected (0.01 sec) 

 

(8) out of the database

mysql> quit

Bye

Guess you like

Origin www.cnblogs.com/xiaochendefendoushi/p/12587068.html