Search code examples
mysqldatabaserestoredatabase-administration

How to restore dump file using Mysql Query Browser


When i am trying to run some queries from the batch file i am getting some error message in my query browser

I have tried with

source E:\Rename_scripts_unused_tables_msp.sql

and i am getting error message like

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'

And the query works fine in command line.

Here is my source file statements:

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;

and more statements like that

What's the reason behind this ??


Solution

  • source is a mysql CLI command - not an SQL query command. It only works using the command line client mysql.

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