如果你想myUser使用myPassword从任何主机连接到mysql服务器的话
进入mysql
mysql -u root -p
mysql> use mysql;
Database changed
mysql> select user,password,host from user;
修改localhost以便外部连接数据库
update user set Host='%' where User='root';
mysql>flush privileges;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'47.101.81.315' IDENTIFIED BY 'daxxaarSD@%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
注:MySQL错误2003:Can't connect to MySQL server (10060)出现此情况
关闭关闭防火墙即可
文章评论(0)