Mysql授权等操作

  • 授权远程任意用户 使用密码xxxxxx访问
mysql > GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxxxxx' WITH GRANT OPTION;  
mysql > flush privileges;  
  • 授权远程某个IP的用户进行访问 使用密码xxxxxx访问
mysql > GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.1' IDENTIFIED BY 'xxxxxx' WITH GRANT OPTION;  
mysql > flush privileges;  
  • 修改某个远程IP访问的密码
mysql> update mysql.user set password=password('新密码') where User="root" and Host="192.168.1.1";  
mysql> flush privileges;  
  • 删除某个用户
mysql>delete from user Where User='root' and Host='192.168.1.1';  
mysql>flush privileges;  

郝先生

继续阅读此作者的更多文章