Categories
mysql

Importing larger SQL files into MySQL

I have a 400 MB large SQL backup file. I’m trying to import that file into MySQL database using WAMPimport, but the import was unsuccessful due to many reasons such as upload file size is too large and so on. So, I’ve gone ahead and made a few changes to the configuration of PHP and MySQL settings under WAMP. Changes made are

Under WAMP->MySQL->my.ini
max_allowed_packet = 800M
read_buffer_size = 2014K
Under WAMP->PHP->PHP.ini
max_input_time = 20000
memory_limit = 128M

Is this the right way to import such a large SQL file using WAMPimport?

If so, did I make the right changes to the configuration files? What are the maximum values allowed for the above variable?

You can import large files this command line way:

mysql -h yourhostname -u username -p databasename < yoursqlfile.sql