授权用户远程访问数据库

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

授权用户远程访问数据库(带管理权限)

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'WITH GRANT OPTION;
FLUSH PRIVILEGES;

取消授权

REVOKE ALL ON *.* FROM 'root'@'%';
FLUSH PRIVILEGES;