mysql 的 Ant 构建失败 [英] Ant build failed for mysql
本文介绍了mysql 的 Ant 构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我使用 mysql 运行 Ant 构建时出现以下错误
When I run Ant build using mysql the following error occur
Cannot run program "mysql" (in directory
"D:\Projects\OBSWorkspace\schoolforms\db"):
CreateProcess error=2, The system cannot find the file specified
当我在本地 cmd 中运行 mysql 时出现以下消息
when i run mysql in local cmd the following message occur
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password:
NO)
如何运行 ant 以从脚本生成和创建数据库.
how to run ant for generating and creating database from the script.
推荐答案
首先你需要尝试通过cmd线连接mysql,例如int这种方式mysql -u root -p root
知道你有能力做到.其次,您可以使用以下代码从 ant build 中完成:
First of all you need to try to connect with mysql via cmd line, for example int this way mysql -u root -p root
to know that you are able to do it. Secondly you can do it from ant build using this code:
<project name="mysql.test" default="mysqltest">
<target name="mysqltest">
<exec executable="cmd.exe">
<arg value="mysql" />
<arg value="-u root" />
<arg value="-p root" />
</exec>
</target>
</project>
您可能尝试不通过 cmd
执行此操作,这就是您无法连接的原因.
You probably try to do it not via cmd
and thats why you can't connect.
这篇关于mysql 的 Ant 构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文