TurnKey Linux Virtual Appliance Library

MySql is not operational after LAMP Stack tklbam-restore

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!

One step closer...doh!

I changed my my.cnf file to link to my local address (192.168.....) I changed this back to the loopback address 127.0.0.1 which fixed mysql. However, my database did not get backed up! I'm working through this now, as the documentation says ALL databases are backed up by default. Hmmm...

Liraz Siri's picture

This may or may not be a bug. How do I reproduce it?

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?

max_allowed_packet error

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.

A Small Database Works Fine- Use A Big One to Reproduce

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.

Resolved Issue

I resolved the max_allowed_packet error with the solution documented here:

http://www.turnkeylinux.org/forum/support/20110105/tklbam-gives-error-bi...

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?

Enhancements for Ease Of Use - LAMP Appliance

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!

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)