【问题标题】:How to restore dump file using Mysql Query Browser如何使用 Mysql 查询浏览器恢复转储文件
【发布时间】:2012-10-26 13:21:48
【问题描述】:

当我尝试从批处理文件中运行一些查询时,我在查询浏览器中收到了一些错误消息

我试过了

source E:\Rename_scripts_unused_tables_msp.sql

我收到类似

的错误消息
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source   E:\Rename_scripts_unused_tables_msp updated.sql' at line 1'

并且查询在命令行中运行良好。

这是我的源文件语句:

rename table appliance_backup_usage_history to unused_appliance_backup_usage_history;

rename table backup_core_server to unused_backup_core_server;

rename table bdr_vms to unused_bdr_vms;

rename table client_details1 to unused_client_details1;

rename table client_service_technologies_backup to unused_client_service_technologies_backup;

rename table cloud_instances to unused_cloud_instances;

还有更多类似的语句

这背后的原因是什么??

【问题讨论】:

  • 我们需要查看源文件
  • 文件是否包含use somedatabase;
  • 是的,它在命令行中运行良好(我已经选择了数据库,然后运行了脚本)

标签: mysql database restore database-administration


【解决方案1】:

sourcemysql CLI 命令 - 不是 SQL 查询命令。它只能使用命令行客户端mysql

https://dev.mysql.com/doc/refman/5.7/en/mysql-batch-commands.html

【讨论】:

    猜你喜欢
    • 2011-07-22
    • 2020-06-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多