tags:

views:

13

answers:

2

I have a text file with commands to, say, create a table. How do I execute all the instructions in this file? I'm only acquainted with using the prompt.

+1  A: 

Connect with MySQL Command Prompt.

Run:

source /path/to/file
Paul
+2  A: 

Do keep in mind that you will also probably need to pass your credentials.

You can always use < operator:

$ mysql < your_file.sql
Pablo Santa Cruz
`mysql db_name < your_file.sql` is also useful sometimes
Dmitry Yudakov