mysql数据库访问权限限制设置

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

    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;

 

posted @ 2018-07-13 11:13  Mr.peter  阅读(10194)  评论(0编辑  收藏  举报