在用户 mysql 下
1、查询远程权限:
SELECT
HOST,
USER,
PASSWORD
FROM
USER;
2、打开远程权限
UPDATE USER
SET HOST = '%'
WHERE
USER = 'root'
AND HOST = 'localhost';
FLUSH PRIVILEGES;
3、关闭远程权限
UPDATE USER
SET HOST = 'localhost'
WHERE
USER = 'root'
AND HOST = '%';
FLUSH PRIVILEGES;