当我尝试从批处理文件运行某些查询时,我在查询浏览器中收到一些错误消息
我试过
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;
以及更多类似的陈述
这背后的原因是什么?
答案 0 :(得分:1)
source
是mysql
CLI命令 - 不是SQL查询命令。它仅适用于命令行客户端mysql
。
https://dev.mysql.com/doc/refman/5.7/en/mysql-batch-commands.html