mysql installation process and precautions

1.1  Downloads:

 I downloaded the zip package 64-bit systems:

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

Download the zip package:

 

After downloading codecs: D: \ software installation packages \ mysql-5.7.20-winx64

1.2  configuration environment variable:

Variable name: MYSQL_HOME

Variable values: E: \ mysql-5.7.20-winx64

path was added:% MYSQL_HOME% \ bin;

  

1.3  generates data files:

Run as administrator cmd

Enter E: \ bin under \ mysql-5.7.20-winx64

Run: mysqld --initialize-insecure --user = mysql in E: generating a data directory \ mysql-5.7.20-winx64 the directory

 

1.4  start the service:

Execute the command: net start mysql start mysql service, if prompted: service name is invalid ... (there is a workaround == Step back: 1.5);

1.5  solve start the service failure ( error ) :

Tip: The service name is invalid

Solution:

Execute the command: mysqld -install can (do not need my.ini configuration file Note: Many online writing needs my.ini configuration file, in fact, do not need my.ini configuration file can also be, I placed my.ini file before, but prompt service can not start after the successful launch my.ini delete)

If the following figure appears, you need to go to the mysql Explorer whole process is over, you can restart.

 

1.6  Login mysql:

登录mysql:(因为之前没设置密码,所以密码为空,不用输入密码,直接回车即可)

E:\mysql-5.7.20-winx64\bin>mysql -u root -p

Enter password: ******

1.7. 查询用户密码:

查询用户密码命令:mysql> select host,user,authentication_string from mysql.user;

 

1.8. 设置(或修改)root用户密码:

设置(或修改)root用户密码:

mysql> update mysql.user set authentication_string=password("123456") where user

="root";   #password("123456"),此处引号中的内容是密码,自己可以随便设置

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

Rows matched: 1  Changed: 1  Warnings: 1

mysql> flush privileges;  #作用:相当于保存,执行此命令后,设置才生效,若不执行,还是之前的密码不变

Query OK, 0 rows affected (0.01 sec) 

1.9. 退出mysql:

mysql> quit

Bye

 

发于:https://www.cnblogs.com/reyinever/p/8551977.html

Guess you like

Origin www.cnblogs.com/yx88/p/11258133.html
Recommended