默认情况下,MySQ不允许远程访问,需进行如下设置:
mysql>use mysql;mysql>update user set host = '%' where user ='root'; //设置root用户可以用所有主机连接数据库mysql>flush privileges;mysql>select 'host','user' from user where user='root';mysql>quit
OK。远程连接成功!