How to make mysql accessible from the external network: first modify the mysql configuration file and add relevant code to the configuration file; then restart the mysql service and execute [service mysql restart]; finally create a host and authorize the user That’s it.
##Related learning recommendations: mysql video tutorial
How to allow mysql to be accessed by the external network:
1. Set the MySQL service to allow external network access Modify the mysql configuration file, some of which are my.ini (windows), some are my.cnf (linux), Add[mysqld] port=3306 bind-address=0.0.0.0
mysql -u root -p
mysql> use mysql;
mysql> select user,host from user;
mysql> update user set host='%' where user='root'; mysql> flush privileges;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypwd' WITH GRANT OPTION; mysql> flush privileges;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.133.128' IDENTIFIED BY 'mypwd' WITH GRANT OPTION; mysql> flush privileges;
The above is the detailed content of How to allow mysql to be accessed from the external network. For more information, please follow other related articles on the PHP Chinese website!