Importing huge MySQL dump under Windows.

Blog / PHP ·

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;


Krasimir Tsonev With over two decades of deep programming expertise, I offer comprehensive web consultancy and stack audits, alongside specialized workshops, training, and engaging public speaking to elevate your team's skills and optimize your digital presence. Contact me.

Keywords: mysql dump table hugedump sql sql table hugedump root h localhost u root h mysql command
Share the post on Twitter, Facebook, LinkedIn