可能是MySQL没有对你要连上的IP地址(主机)进行授权吧
grant all on *.* to 'root'@'IP' identified by 'password';
然后,再连连看行不行

解决方案 »

  1.   

    1。先检查一下mysql服务器上mysql服务打开没有
    2。在mysql命令行下执行:grant all on 数据库名.表名 to '用户'@'%' identified by 'password';
       如:grant all on test.* to 'root'@'%' identified by '&dsjkdf03*';
       (如果@后面是%的话,是任何人都能访问的,密码最好设长一点,麻烦一点)