Chris Lee's picture

I've successfully installed a LAMP appliance on VMWare, but when backing up and restoring, the Mysql is not operational on either EC2 restores or a restore to a blank Turnkey LAMP appliance. Any ideas or any settings i need to tweak to get this running?

Trying to login into the mysql terminal or phpMyAdmin with my root account does not work (access is denied) even though this is fine on the original LAMP appliance which I backed up.

Please help as I'd like to get a backup/restore workflow going!

Liraz Siri's picture

We always strongly recommend that users test their backups so as not to get caught with their pants down at the worst possible timing. It sounds like you're doing exactly that. Kudos, and thank for reporting this.

Regarding the problem you are describing, this may be a bug in how tklbam handles certain usage scenarios/MySQL configurations we didn't anticipate. It would be helpful to receive more information on how you triggered it. In other words, what is the smallest change to the configuration I can make to a standard TurnKey LAMP box to reproduce this behavior?

Chris Lee's picture

I tried to reset the debian_sys_maint account as this was one of the issues, I grabbed the password from /etc/mysql/debian.cnf.

After jumping this hurdle, I still get failures because of "max_allowed_packet". I then tried increasing this mysql env variable in /etc/mysql/my.cnf from 16M to 64M, with no luck.

My database is about 12 MB in size, so I'm not sure why it's not working. Besides the change to max_allowed_packet, all I've done is run :

a2enmod rewrite

for Drupal Clean URLs.

I'll try tonight to recreate the problem with a fresh installation of the LAMP appliance.

Chris Lee's picture

The tklbam-backup/restore functions indeed work fine with a small database. So I guess the way to reproduce this is to use a database ~15mb large (which is realistic for a production server).

Sucessfully backedup/restored a LAMP appliance VM to another blank LAMP appliance VM. Also sucessfully restored the same to an EC2 server.

Chris Lee's picture

I resolved the max_allowed_packet error with the solution documented here:

Bear in mind that setting /etc/mysql/my.cnf environment variable for max_allowed_packet does not help; only when I set the "maximum packet size" in Webmin's "Mysql server configuration" area did this fix it up.

Therefore, a straight restore to EC2 will not work-- you must first instantiate a LAMP appliance, and pre-emptively set the max allowed packet to 64M or something larger than your database. The same goes for a fresh VM.

Perhaps we could make this a little more user friendly?

Chris Lee's picture

Some solutions to make this easier for people:

1) Increase Mysqls "Maximum Packet Size" from 16M to something like 32M or 64M

2) Put this down as a FAQ instructing people to use Webmin to increase this packet variable rather than the my.cnf file

Now that I know what to do, this is working a charm. I love that I can use VMWare to run as many dev servers as I like, and easily deploy to EC2. Thanks for your work on this Liraz!

Add new comment