author: Krasimir Tsonev

Krasimir is a blogger, who writes and speaks.
He loves open source and codes awesome stuff.

Importing huge MySQL dump under Windows.

I just received a 250MB dump of a database and I needed to see what is it inside. As you may guess, PHPMyAdmin is not a good option in this case. I decided to use the command line.

First of all, you should have mysql command available in your command prompt. I firstly tried this
mysql -u root -h localhost my-sql-table < ./hugedump.sql
and I got
The '<' operator is reserved for future use. ....
I'm using PowerShell and it looks like there is a problem with that. Then I found the following solution:
&cmd /c 'mysql -u root -h localhost my-sql-table < .\hugedump.sql'
However, this doesn't work either. I still had to use mysql command but not like that. Here is the final workaround:
mysql -h localhost -u root
Type your password after that. Select the empty database where the dump will be inserted:
use my-sql-table;
After that simply type
source ./hugedump.sql;
blog comments powered by Disqus