Last Updated: February 25, 2016
·
557
· jevin

Working with huge databases

Lets face it! We all hate huge databases. They're slow and they viciously run circles around phpMyAdmin. Which leaves us with no other choice than to fire up that old trusty SSH shell.

Personally, I see SSH as a giant ball pool. I'd jump in one of them any day. So naturally, I have my way of taming that fat, bloated, McDonalds eating database using 2 commands!

  • Let's start with my favorite MSQL command. It dumps the database into a file.

mysqldump -u dbuser -pdbpassword dbname > dbname.sql

  • Actually I lied, this is my favorite command. It imports the file created before into the database.

mysql -u dbuser -pdbpassword dbname < dbname.sql

Now get crackin', Sparky!

3 Responses
Add your response

This works also on a small databases :)

over 1 year ago ·

Of course, these are basic mysql commands that work with any database size.

over 1 year ago ·

What is the purpose of doing this with large databases? Looks like a basic export the db and import on a new server.

over 1 year ago ·