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;