Transfer MySQL Databases between servers

In some cases you don’t necessarily want to dump a database to a file to import into another database. Like when you want to migrate from one server to another. So you could ‘dump’ the data from one server instance and immediately import into the other all with one command:

mysqldump -h <server ip> -u User -p <password origin-db-name |
mysql -h <server ip> destination-db -u User -p <password>
Note that I have the -h parameter specified on each side. In my case I issued the command from my EC2 instance which connects to my database contained in an RDS instance on Amazon Web Services.

You will need to make sure that port 3306 is opened on the remote server and that your user has remote access.

Example with parts masked out for security reasons




AMI Sophos not rendering correct time

I chose to use the Sophos AMI due to the built in Anti-Virus offering a layer of security, in that regard, and minimize my amount of time installing applications, configuring, testing, etc.

After launching one of these instances I found the reported date and time being off by 6 hours.  In researching the matter it was found that the Network Time Protocol (ntpd) Service was not running. Following are the commands used to resolve the issue:

Switch to the root account. (Easier than entering sudo for several commands.

Verify status of the NTP Daemon

If the status is stopped, you can start it by entering

Now you can verify the date and time.

You may need to restart your instance.

Keep in mind you will need to make sure your timezone is set properly. You can do this with the following command replacing America/Phoenix with your timezone information accordingly.

You may need to make UDP port 123 available for both inbound and outbound through your firewall.