How to run a .sql file as part of a MySQL Workbench 6.2 query?

安稳与你 提交于 2019-12-06 00:48:28

The source command is a pure (command line) client specific command which MySQL Workbench does not support. Just load the sql file to run it.

Update (after you edited your question)

Your SQL file contains DDL. LOAD DATA INFILE however only imports DML. There's no replacement for the MySQL commandline client's SOURCE command. Support for that in MySQL Workbench is however on our todo list.

Shammi Jayasinghe

You can run scripts on MySqlWorkBench as follows:

From the file menu, Select "Run SQL Script".

Then, In the popup window, Open the script from your machine.

Then Select the schema name which you are going to execute this script. (Previously i created the schema using the command "create database REGISTRY_LOCAL1;")

Then execute the script.

Just remove the quotes and semicolon. The command source is not SQL and it doesn't like quotes and semicolons. :)

source /Users/[username]/Documents/company/department.sql
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!