my-cmd - MySQL interactive and batch query command-line tool »

Download my-cmd Free Trial »

Run sql scripts from command or file

Run scripts from command

example:

my-cmd > select * from media_messages;


Run scripts from file

In interactive mode:

my-cmd>source #sqlfile#;

example:

my-cmd > source e:\temp\tables\insert_data.sql


In batch mode:

my-cmd dsn="username:password@host:port/dbname" task=source sqlfile=#sqlfile#

example:

my-cmd dsn="pan:withdata@192.168.0.102::3306/test" task=source sqlfile=e:\temp\tables\insert_data.sql