Mysql 命令行恢复错误“系统找不到指定的文件。”

发布于 2024-09-29 12:15:19 字数 535 浏览 0 评论 0原文

我遇到了一个相当奇怪的问题,我有一个自动构建工具,它可以调用 mysql 命令行来拆卸,然后从 SQL 文件设置数据库。

在一台计算机上它工作正常,它基本上调用:

Mysql -h {Connection::Host} -u {Connection::User} --password={Connection::Password} < {sqlFile}

我刚刚在另一台计算机上检查了它并尝试构建,但它一直给我错误“系统找不到指定的文件。”。 MySQL 版本与 5.1 相同,其他文件没有更改。我所知道的唯一不同的是构建文件的部署位置...在家里它们被部署到:

d:/code/projects/xxxxx/

而在这台不起作用的计算机上它被部署到:

c: \Documents and Settings\xxxxxx\My Documents\Projects\Other\xxxxxx\

互联网带回了一些可能性,例如路径中的空格,但是我尝试将 -i 添加到命令中(忽略空格),但没有什么区别。

有人有什么想法吗?

Ive got a rather strange issue, ive got an automated build tool that is calling through to the mysql command line to teardown then setup a database from an SQL file.

On one computer it is working fine, and its basically calling:

Mysql -h {Connection::Host} -u {Connection::User} --password={Connection::Password} < {sqlFile}

Ive just checked it out on another computer and tried to build and it keeps giving me the error "The system cannot find the file specified.". The MySQL versions are the same 5.1 and no other files have changed. The only thing that i know is different is where the build files are deployed... at home they are deployed to:

d:/code/projects/xxxxx/

whereas on this computer that doesn't work it is deployed to:

c:\Documents and Settings\xxxxxx\My Documents\Projects\Other\xxxxxx\

The interwebs brought back a few possibilities such as the spaces within the path, however ive tried adding the -i to the command (ignore spaces) and it made no difference.

Anyone have any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

二智少女 2024-10-06 12:15:19

这很可能是路径中的空格。空格后面的部分将作为不同的参数传递给程序。

尝试用双引号将 {sqlFile} 引起来。

Mysql .... < "{sqlFile}"

It's most likely the spaces in the path. The part after the space will be passed to the program as a different parameter.

Try surrounding {sqlFile} with double quotes.

Mysql .... < "{sqlFile}"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文