我用的是mysql的root建立的连接,为何还没有权限?最后进行了如下修改才可以:mysql –pmysql> grant all privileges on enong.* to your_user_name@localhost identified by ‘your_password’ with grant option;mysql> grant all privileges on enong.* to your_user_name@’ns.sctown.com’ identified by ‘your_password’ with grant option;mysql> grant all privileges on enong.* to your_user_name@’192.168.1.2’ identified by ‘your_password’ with grant option;mysql> grant all privileges on enong.* to your_user_name@’%’ identified by ‘your_password’ with grant option;mysql>exitConnection conn = DriverManager.getConnection("jdbc:mysql://ns.sctown.com/enong","your_user_name","your_password");