1.Download
Download address: https://dev.mysql.com/downloads/mysql/
2. Unzip the compressed package
3. Configure environment variables
1. Create a new system variable MYSQL_HOME
(installation path)
2. Append the MySql bin directory %MYSQL_HOME%\bin at the end of the system variable path (note: if there is no semicolon at the end, add a semicolon to separate it):
4. Open cmd as administrator and jump to the bin directory of mysql:
mysqld --initialize --console
5. If the installation encounters this error, the dll file is missing.
You need to install Microsoft's commonly used runtime library. I provide the installation method here.
Microsoft runtime library installation software sharing address: https://www.aliyundrive.com/s/JcRiBkdjvgt.
Just click Next to install.
6. Then execute it again.
mysqld --initialize --console
Record the initial password.
Start the database: net start mysql8
mysql -uroot -p. Log in and enter the password according to the prompts.
Remember the initial password. If you accidentally turn it off and the password is not saved, delete the data directory and re-initialize it.
7. Change remote login. The default is only local login to the database, as can be seen from the following table:
use mysql;
select User, authentication_string, Host from user;
change remote login
Remote login error
alter user 'username'@'%' identified with mysql_native_password by 'password';
flush privileges; refresh
update user set Host='%' where User='root'; change the host in the user table
flush privileges; refresh