How to modify mysql login permissions: first log in to mysql; then modify the user table of the mysql library, change the host item from localhost to [%]; and finally change the corresponding ip.
How to modify mysql login permissions:
1. Log in to mysql
mysql -u root -p
2. Modify the user table of the mysql library and change the host item from localhost to %. %This means that any host is allowed to access. If only a certain IP is allowed to access, it can be changed to the corresponding IP. For example, localhost can be changed to 192.168.1.123, which means that only the IP 192.168.1.123 of the LAN is allowed to remotely access mysql. .
mysql> use mysql; mysql> update user set host = '%' where user = 'root'; mysql> select host, user from user; mysql> flush privileges; 防火墙开放3306端口
More related free learning recommendations: mysql tutorial(Video)
The above is the detailed content of How to modify mysql login permissions. For more information, please follow other related articles on the PHP Chinese website!