1.在mysql库中,复制user=root,host=‘localhost’的数据,修改localhost为%
数据库信息:
user host
------ -----------------
root %
root localhost
2.赋权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'root' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'
IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
3.重启mysql