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



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

i'm using mysql workbench 6.2 [windows7] , want create script steps. among steps, have series of .sql files stored on computer create , populate tables. want run these files query tab every time utilize command:

source c:/users/[username]/desktop/sampdb/create_president.sql;

i error 1064, says

"error code: 1064. have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'mysql> source c:/users/[username]/desktop/sampdb/create_president.sql @ line 1 "

can tell me i'm doing wrong? how can refer .sql file within mysql workbench script?

what code should utilize in mysql workbench instead of source? have tried load info local infile 'c:/users/[username]/desktop/sampdb/create_president.sql'; didn't work either. thought can wrong?

*just additional information, create_president.sql contains next code:

drop table if exists president; #@ _create_table_ create table president ( last_name varchar(15) not null, first_name varchar(15) not null, suffix varchar(5) null, city varchar(20) not null, state varchar(2) not null, birth date not null, death date null );

the source command pure (command line) client specific command mysql workbench not support. load sql file run it.

update (after edited question)

your sql file contains ddl. load info infile imports dml. there's no replacement mysql commandline client's source command. it's back upwards in mysql workbench on our todo list.

mysql sql mysql-workbench

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -