How to execute sql file at MySQL command line by Shiji Pan Posted on August 29, 2013 by Shiji Pan If you’re at the MySQL command line mysql> you can declare the SQL file as source, like: mysql> source 'path/to/test.sql'; Or use the MySQL command line client: mysql -hhostname -uuser database < path/to/test.sql