I have used Linux to import a large mysql dump file (into a new database), but am new to how the process works in a local LAMP environment using xampp, as xampp does not support SSH. I've dowloaded the large_dump_file.sql from the Linux server to my local system. I'm using Windows XP and have used xampp to setup LAMP. I am able to access the local_database via phpMyAdmin, but the dump file is too large to import using that app. I'm trying to import the file via the command prompt, but so far with no success.

At the prompt:

cd ..
cd ..
cd xampp
cd mysql
cd bin

I've found that mysqlimport is used to import .csv and .txt files, and mysql is used to import .sql files, but can't find documentation as to whether or not to use the -u -p options so I've tried many variations of the command with no luck. What would be the proper command?

I've modified the hosts, virtual-hosts conf, and apache config files. Do I need to change any other config files on my local system?


mysqldump is to dump database, that can be importing using the command line utility mysql

At your promt write:

mysql -h localhost -p -u <mysql-user> <database-name> < large_dump_file.sql

where is the user that has access to your db. If you don't have a db, create it before!

  • 2
    If it is a large db dump, make sure your max_allowed_packet size is big enough to accommodate the largest field sizes you might have. – lilott8 Mar 4 '11 at 15:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.