mysql compressed package, cmd installation

1. Download the required mysql zip package on the mysql official website

2. Set Windows environment variables: Right-click on the desktop "Computer"-Properties-Advanced System Settings-Environment Variables-System Variables-Path, add the path D:\mysql-5.7.16\bin at the end of the open variable value box, save

3. Enter cmd in Windows operation, enter the command line window, enter D:, press Enter to enter the D drive, then enter cd mysql-5.7.16\bin, press Enter to enter the bin directory, and enter the following three commands in turn;

     a. Command: mysqld --initialize to initialize mysql and generate files in data;

     b. Command: mysqld -install install mysql  

     c. Command: net start mysql to start the mysql service

4.  Execute bin\mysql -u root -p and press Enter, enter a random password (in fact, you can copy and paste) to enter mysql;

5. If successful, you will find that the prefix is ​​changed to  mysql>  ;

6. Change the password: mysql>alter user 'root'@'localhost' identified by 'new pwd'; Enter (don't forget the semicolon at the end;);

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325749815&siteId=291194637