This article takes MySQL5.7.11 as an example to introduce the installation of mysql5.7.zip under the win system.
1. Prerequisites:
1. win administrator
2. MySQL installation package (zip package)
2. Installation process
First unzip the MySQL installation package to the path you want to install (such as D:javaidemysql-5.7.11-winx64), then edit the my-default.ini file, and configure the database root directory, data storage directory, and software port under [mysqld] :
The code is as follows:
D:javaidemysql-5.7.11-winx64bin>mysqld.exe --defaults-file="D:javaidemysql-5.7.11-winx64my.ini" --initialize --explicit_defaults_for_timestamp
After successful initialization, if there is no corresponding prompt, DOS will return to the command receiving status:
D:javaidemysql-5.7.11-winx64bin>
4. Start the database and change the password
When the database is initialized, you can start the database service. Use the net start mysql command to start:
D:javaidemysql-5.7.11-winx64bin>net start mysql
Additional supplement: Stop mysql service command
D:javaidemysql-5.7.11-winx64bin>net stop mysql
After the database startup is completed, the corresponding success message will be prompted:
MySQL service is starting...
The MySQL service has been started successfully.
Then, you can find the login password. The login password is in the log file of the data directory (the datadir directory configured in my.ini). For example, mine is under D:javaidemysql-5.7.11-winx64data. The file name is Computer Name.err; for example, my computer is named LAPTOP-J709AKSF, and the password is in the LAPTOP-J709AKSF.err file. Open the file with Notepad or notepad++ or any text editor, ctrl+f, and search for password Keywords,
Find the following line of information:
2016-03-16T02:41:45.969406Z 1 [Note] A temporary password is generated for root@localhost: r1diaBlw&Hgp
The corresponding login password is r1diaBlw&Hgp
Log in to mysql with root:
D:javaidemysql-5.7.11-winx64bin>mysql -u root -p
Enter the found password:
Enter password: ************
After successful login, you can change the root password (change the password to root as follows):
mysql> set password = password('root');
After the modification is successful, the following prompt will appear:
Query OK, 0 rows affected, 1 warning (0.27 sec)
After the modification is successful, you can log out and log in with the new password.
mysql> exit
Bye
The above is the installation and configuration tutorial of mysql 5.7.11 winx64. I hope it will be helpful to everyone’s learning and I hope you will support me.