I’ve hosted most of my sites on a DreamHost shared server since 2005. It has always been easy to use and well maintained. But after DreamHost increased prices in March, I decided it was time to look at what else is available.
DigitalOcean has been on my radar for quite a while due to its reputation and inexpensive cloud servers (as little as $5 per month). I can run 2 or 3 cloud servers on DigitalOcean for about the same price as my DreamHost subscription. The downside of course is that the cloud servers are unmanaged, which means potentially more work for me to maintain. I have some experience running an unmanaged Rackspace server in my previous job, so I decided to go ahead and give it a try.
Continue reading Setting up a LAMP stack on DigitalOcean
Here’s another DreamHost tip, this time for using mysqldump to export a MySQL database. You could always use phpMyAdmin to export a database, but there are times when the mysqldump command is either easier, better, or in my case when I had an extremely large database, the only option.
DreamHost has a mysqldump page in their wiki that explains how to set up a mysqldump script as a cron job, but I wanted to run this as a standalone command. Here is what I came up with:
mysqldump -c -h [domain] --user [user] --password=[password] [database] > [filename]
Note: Any of the values needed for this command can probably be found on the “MySQL Databases” section under the “Goodies” menu item in the DreamHost control panel.
- [domain] is the hostname associated with the database you are wanting to export.
- [user] is a user with access to the database.
- [password] is the password for the user.
- [database] is the name of the database.
- [filename] is the name of the file you would like to save from the export, ending in
.sql. You can put a file path in here as well. If you don’t supply a path, it will just save the file in your current directory.
Here is an example usage of the command:
mysqldump -c -h mysql.mydomain.com --user myuser --password=mypassword mydatabase > mydatabase.sql