windows server 2012mysql installation configuration

1.Download

Download address: https://dev.mysql.com/downloads/mysql/
Insert image description here

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.

Insert image description here
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.
Insert image description here
6. Then execute it again.

mysqld --initialize --console

Record the initial password.
Start the database: net start mysql8
Insert image description here
mysql -uroot -p. Log in and enter the password according to the prompts.
Insert image description here
Remember the initial password. If you accidentally turn it off and the password is not saved, delete the data directory and re-initialize it.
Insert image description here
Insert image description here
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;
Insert image description here
change remote login
Insert image description here

Remote login error
Insert image description here
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

Guess you like

Origin blog.csdn.net/A_awen/article/details/122671791