请各位看看:C:/Program Files/MySQL/MySQL Server 5.0/bin/mysql -h127.0.0.1 -uroot -padmin -f -D rfcard<E:/20097916.sql  在cmd下可以运行  数据库还原了  但是在java里调用 Runtime.getRuntime().exec(stmt2);就不行stmt2=C:/Program Files/MySQL/MySQL Server 5.0/bin/mysql -h127.0.0.1 -uroot -padmin -f -D rfcard<E:/20097916.sql
为什么呀

解决方案 »

  1.   

    具体你的什么错误信息?在DOS下你的那句估计也不行。需要如下。
    "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql" -h127.0.0.1 -uroot -padmin -f -D rfcard <E:\20097916.sql1. 路径中的空格
    2。\ 符号。
      

  2.   

    路径中有空格,要加引号
    "C:/Program Files/MySQL/MySQL Server 5.0/bin/mysql" -h127.0.0.1 -uroot -padmin -f -D rfcard <E:/20097916.sql
      

  3.   

    [code=BatchFile]H:\>C:/Program Files/MySQL/MySQL Server 5.1/bin/mysql -h127.0.0.1 -uroot
    'C:/Program' is not recognized as an internal or external command,
    operable program or batch file.H:\>[/code]
      

  4.   

    [code=BatchFile]H:\>C:/Program Files/MySQL/MySQL Server 5.1/bin/mysql -h127.0.0.1 -uroot
    'C:/Program' is not recognized as an internal or external command,
    operable program or batch file.H:\>[/code]
      

  5.   

    需要加上引号后才能在DOS下执行。如下[code=BatchFile]H:\>"C:/Program Files/MySQL/MySQL Server 5.1/bin/mysql" -h127.0.0.1 -uroot
    ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: N
    O)H:\>[/code]