Tuesday, March 27, 2007

MySQL comandline query script execution

At times when you want/ need to run a huge query script manually, the MySQL query browser might not work and throws an 'out of memory error'.

In such a case you could use the mysql command line execution -
\MySQL\MySQL Server 4.1>mysql -u "user-name" -p "database-name" < "SQL script"

The command will prompt you for a password.

Also, the command line execution is way way quicker than trying to run the script using the MySQL Admin/QueryBrowser tools.

As an example - it took me 40 minutes to load our 9GB database on my local, while it plain hung-up through the MySQL Admin UI tools
mysql command line prompt query script execution fast fastest table only

No comments: