Wednesday, April 13, 2011

Mysql - execute SQL statements in a script file

1. without username / password

shell> mysql db_name < sqlfile.sql > output.txt

2. with username / password

mysql -u username -p database_name < sqlfile.sql


No comments: