Mysql from an external file

From the command-line:

mysql -u username -ppassword database < filename

From within MySQL:

Log into mysql i.e. mysql -u -p [database]
mysql> source [filename]

Leave a Reply