How to set the specified ip remote access connection in Mysql

Scenes

Mysql is installed on a remote Windows server and needs to be configured so that the specified ip can be accessed.

If the specified ip is not configured in advance, it will prompt when accessing:

 

Note:

Blog:
https://blog.csdn.net/badao_liumang_qizhi
Follow the public
account Domineering
programmers Get programming-related e-books, tutorial pushes and free downloads.

achieve

Log in to the server, open cmd in the bin directory under the mysql installation directory, connect to log in to mysql

mysql  -u root  -p

Then enter the root password to log in

Execute the following statement

GRANT ALL PRIVILEGES ON *.* TO 'root'@'能访问的ip' IDENTIFIED BY 'root的密码' WITH GRANT OPTION;
flush privileges;

Then if you want to set all IPs to be able to connect remotely

Just change the accessible Ip to %.

 

 

 

Guess you like

Origin blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/115308120