1. Unzip the package to the specified directory
2. Enter the MySQL bin directory through cmd
3. Since there is no data folder in the compressed package of MySQL8, there is no relevant administrator (root) account to initialize... So execute it in cmd
mysqld --initialize to initialize, after the initialization is successful, the data folder and a pool of files in it will be automatically generated
The very important thing here is that in the last line of the cmd console output there is a password randomly generated by the initialization root , and copy it and save it in Notepad (this password is a bit complicated)
4. Register MySQL with the service of window... Use the command mysqld --install in the bin directory of mysql of cmd
5. Start MySQL using: net start mysql
6. After the startup is successful, you can enter MySQL at this time. Since the first time you enter... you will be asked to use the alter user command to change the password first.
7. Change the root user password
cmd, in the MySQL bin directory...
Log in to the root user : mysql -u root -p and press Enter, and then the password appears:
Then enter the password generated by initialization (manual input, do not copy), and then press Enter
change Password:
set password=password('replace with your own password');
alter user 'root'@'localhost' password expire never;
flush privileges;
8. Use the quit command to exit mysql in cmd
At this time, log in to MySQL with the new password again.