How do I export/import a large MySQL database using the Terminal

You have a large database. Let’s say it’s over 200MB and you do the traditional export from phpMyAdmin. Or you might try the traditional import of a SQL database using phpMyAdmin. Either way, phpMyAdmin is going to give you problems. It will be slow and may not work. What’s the solution?

Use the terminal.

For Export using the Terminal:

[prettify]
./mysqldump -u root -p wp_database > /Applications/MAMP/htdocs/symposium10_wp/wp_db_onezero.sql
[/prettify]

For Import using the Terminal:

[prettify]
/applications/MAMP/library/bin/mysql -u root -p wordpress_db < /Applications/MAMP/htdocs/backupDB.sql [/prettify] If the above doesn't make sense to you and you need more info, please read this excellent step-by-step tutorial.

(Thanks J.W.)

Leave a Reply

Your email address will not be published. Required fields are marked *