语句
赋予权限
?> ON .前一个*代表库后一个代表表
代码语言:javascript复制GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxxxx' WITH GRANT OPTION;
刷新权限
代码语言:javascript复制flush PRIVILEGES;
示例
代码语言:javascript复制MySQL [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'admin123' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
MySQL [(none)]> flush PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
//删除远程权限
MySQL [mysql]> delete from mysql.user where user='root' and host='%';