你在命令行下用mysql -u ,然后跟你的用户名和密码来试试。
应该是你的服务器没有配置好

解决方案 »

  1.   

    谢谢楼上的回复,
    我在终端是可以启动MySQL的,自己顶
      

  2.   

    唉,自问自答,谢谢dropship(梦,一定要圆) 
    From the mysql command-line client, logged in as a user that can grant privileges, issue the following command:GRANT ALL PRIVILEGES ON [dbname].* to
    '[user]'@'[hostname]' identified by
    '[password]'replacing [dbname] with the name of your database, [user] with the user name, [hostname] with the host that MySQL Connector/J will be connecting from, and [password] with the password you want to use. Be aware that RedHat Linux is broken with respect to the hostname portion for the case when you are connecting from localhost. You need to use "localhost.localdomain" for the [hostname] value in this case. Follow this by issuing the "FLUSH PRIVILEGES" command.
      

  3.   

    这个问题我以前遇到过,我们一般是把权限给Host 'localhost',但是没有给:Host 'localhost.localdomain' 所以就会出错,在mysql 里赋个权限就可以了