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!
Written by Jevin Sewaruth
Related protips
3 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#