Home > Database > Mysql Tutorial > body text

How to modify mysql login permissions

coldplay.xixi
Release: 2020-10-21 16:46:13
Original
4204 people have browsed it

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

How to modify mysql login permissions:

1. Log in to mysql

mysql -u root -p
Copy after login

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端口
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template