MySql默认不能通过远程IP地址访问,要这样设置才行
1.在命令行,用mysql -u root -p登陆mysql
2.然后GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
表示你用myuser用户名,密码mypassword可以远程登陆mysql,并且授予所有权限