I'm trying to create an EBS AMI from my running EC2 instance to reuse my LAMP fully configured (for my needs). I got my website up and running yesterday on this EC2 instance my MySQL was working fine until this morning (it's not that difficult to install LAMP thanks to yum so I can't see how I could go wrong with this; having said that, it's always difficult for one to realise his own errors)

  1. I have seen "Loading, please wait ..." for a few hours now. How do I know whether this is completed or its progress? enter image description here

  2. Shortly after I tried to create the AMI image from my EC2 instance, I encountered database connection error

can't connect to local mysql server through socket '/var/lib/mysql/mysql.sock'

I was able to restart mysqld at first. But database connection was down again. This time, I could not restart mysqld anymore. It shows

MySQL Daemon failed to start.

Could my attempt to create the AMI by any chance cause the MySQL server to reboot or corrupt?

I did a lot of searched and have done the following although I think I shouldn't have to do any workaround for MySQL server to work here

chown -R mysql.mysql /var/lib/mysql/

I also found this workaround but I'm very reluctant to follow due to my belief and the fact I would need to understand this problem first.

Any help would be greatly appreciated. Getting back to searching for a solution for the MySQL server problem ...


1) The issue with MySQL server either resolved itself or I successfully resolved it. It was not that difficult after all. This issue appeared to be independent from the creating AMI process

2) The answer that I got from AWS support on how long it would take to create an AMI image from a running EC2 instance is that it depends and I have to wait for the process to complete.

1 good practice I have learnt from serverfault.com is that I should have MySQL on a separate EC2 instance or better yet, RDS and that definitely save troubles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.