[Happy] code on a Windows environment using the mysql database (d) opening of the remote access

Since MySql-Server for security considerations default only allows the machine (localhost, 127.0.0.1) to access the connection.

Require special configuration before you implement remote client access, during debugging, this function is quite necessary.

1. In connection with the server, the operating system database mysql

Command: mysql -u root -p

Enter the password, login mysql

carried out 

  use mysql;

  

 

 

 Query user table command:

select  User,authentication_string,Host from user;

  

 

   Here you can see the default host is localhost access

The next step is the most important part:

    1. GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' ; 

    123456 here to give you permission to add password set by the user,% represents all hosts can also be specific to your host ip address.

  2.flush privileges;  

 This step must be done, or can not succeed! Phrase represents reload grant permission to data from mysql database table, because the MySQL privileges are placed in the cache, so the need to reload after the finish to change.

 After you do these two steps, the command again to query the user table

select  User,authentication_string,Host from user;

  

 

 It found that more than one user, the user can access all of the hosts, this time again with sqlyog access connection success!

Guess you like

Origin www.cnblogs.com/mskx/p/11741496.html