【发布时间】:2010-10-27 08:54:37
【问题描述】:
我的 ant 文件中有下一个任务:
<target name="initdb">
<sql driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/dtest"
userid="root" password="oksaoksaoksa" >
<classpath>
<pathelement path="./lib/mysql-connector-java-5.1.13-bin.jar"/>
</classpath>
<transaction src="./init.sql"/>
</sql>
</target>
当我运行它时,我看到了错误:
BUILD FAILED
/home/sbos/projects/texterra-tests/deploy.xml:43: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
但是,我可以使用 mysql 客户端使用这样的登录名和密码登录:
mysql -u root -p
Enter password: <oksaoksaoksa>
Welcome to the MySQL monitor. Commands end with ; or \g.
...
为什么会这样?如果这很重要,我刚刚在 ubuntu 10.10 中安装了 mysql
【问题讨论】:
-
检查端口,是不是只配置了默认3306?