Mysql allows external network access settings: first open mysql and enter the password, and enter [use mysql]; then create a host and authorize the user; finally connect to the mysql server with user root and password pwd.
Mysql allows external network access settings:
1. Open mysql.exe (MySQL Command Line Client ), enter password
2. Enter: use mysql;
3. Query host input: select user,host from user;
4. Create host (if there is " %" this host value, skip this step)
If there is no "%" this host value, execute the following two sentences:
mysql> update user set host='%' where user='root'; mysql> flush privileges;
5. Authorized user
(1) Any host connects to the mysql server with user root and password pwd
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'pwd' WITH GRANT OPTION; mysql> flush privileges;
(2) The host with the specified IP (such as 192.168.1.100) connects to the mysql server with user tuser and password tpwd
mysql> GRANT ALL PRIVILEGES ON *.* TO 'tuser'@'192.168.1.100' IDENTIFIED BY 'tpwd' WITH GRANT OPTION; mysql> flush privileges;
More related free learning recommendations:mysql tutorial(Video)
The above is the detailed content of How to allow external network access settings in Mysql. For more information, please follow other related articles on the PHP Chinese website!