How to move a database > 2MB
Most hosting provider set the limit to the PHP upload function to 2MB which makes it not easy importing databases > 2MB to your new installation if you use e.g. phpMyAdmin as your database management tool. For this cases, you might want to install another application that works differently like MySQL Dumper or use just the most easy way if you have SSH access to your server.
- Upload the sql file to your server.
- Move to the folder the sql file is situated.
- Use the following command to insert the sql file to your database
mysql -u[database_user] -p[database_password] -P[Port] [database_name] < [your_file].sql
Of course, you have to replace the values for [database_user] - your specific database user [database_password] - your spacific database password [Port] - the portnumber of your database in case it is different then 3306 [your_file] - your source database dump
- Take care: No progress bar is shown while uploading the dump. For huge databases, just wait for the next prompt.
For dumping your existing database > 2MB to a sql file, type the following:
mysqldump -u[database_user] -p[database_password] [database_name] > [your_file].sql
[Update 30th June 2016]
In case Profihost is your hosting provider, please use the following command for a database dump:
mysql5dump -u[user_name] -[password] -h127.0.0.1 -P3307 [database_name] > [file_name].sql