1. Download the mysql-5.7.15.zip installation package
2. Unzip to any directory, such as the root directory of the D drive
3. Modify my-default.ini to configure the mysql root directory and data directory, and create a new data directory in the mysql root directory
[mysqld]
# These are commonly set, remove the # and set as required.
basedir = "D:\MySQL-5.7.15"
datadir = "D:\MySQL-5.7.15\data"
4. Run cmd as administrator to install mysql service
5. Initialize the mysql default database and set the root user without an initial password
6. Start the mysql service
To close the service: net stop mysql
7. Log in to mysql and set the root password
d:\MySQL-5.7.15\bin>mysql -u root -p
mysql>update mysql.user set authentication_string=password('admin') where user='root' and host = 'localhost';
mysql>flush privileges;
mysql>quit;
8. Restart mysql
d:\MySQL-5.7.15\bin>net stop mysql
MySQL service is stopping.
MySQL service has been stopped successfully.
d:\MySQL-5.7.15\bin>net start mysql
MySQL service is starting .
MySQL service has been started successfully.
9. Log in to mysql and use the set root password