mysql 命令中 < 的替代方法

alternative for < in mysql command

mysql 命令中的 < 是否有替代方案? 提前谢谢你。

  <exec executable="mysql" dir="${mysql.path}" failonerror="true">
      <arg value="--user=pro"></arg>
      <arg value="--password=pro"></arg>
      <arg value="pro"></arg>
      <arg value="&lt; prdump.sql"></arg>
  </exec>
     <echo message="DB backup/restore"/>

错误:

构建失败,执行返回:1

您可以尝试添加

-e "source prdump.sql"

作为最终参数。

但请注意 MySQL 将在批处理模式下 运行 且不使用历史文件。参见 https://dev.mysql.com/doc/refman/5.7/en/batch-mode.html(实际上这也适用于使用 <)