欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Mysql权限控制 - 允许用户远程连接

程序员文章站 2022-05-31 17:32:51
...

—只能本地访问,设置随意访问

update user set host='%' where host='localhost';

flush privileges;

—随意访问,设置只能本地访问

update user set host = “localhost” where user = “hello” and host= “%”;

flush privileges;

—设置固定的ip可以访问

GRANT ALL PRIVILEGES ON . TO ‘hello’@‘133.22.88.77’ IDENTIFIED BY ‘mysql_password’ WITH GRANT OPTION;

flush privileges;