Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

and thank you for taking the time to look at my question.

I have an ebs-backed ec2 ubuntu server which is running but unreachable.

** There are very stupidly no recent backups **

I made a snapshot of the block, created a volume, spun up a new instance, attached the new volume. I see all the data from my site in the /opt/bitnami/mysql/data directory, but when I go into the mysql console, it shows only information_schema and test when I type show databases;

How can I 'point' mysql to the correct folder?

Thank you!

share|improve this question
    
** There are very stupidly no recent backups ** ok just have to mention that on ec2 that is supper silly. –  coteyr Dec 3 '12 at 22:40

1 Answer 1

up vote 1 down vote accepted

Without knowing your setup its really hard to say but I see two possibilities:

  • Fist check permissions, and make sure that the files and folders under mysql/data belong to mysql:mysql
  • Next cat /etc/mysql/my.cnf | grep datadir That's where mysql is looking for your files. You can either copy the files there or change that line in /etc/mysql/my.cnf. Make sure to turn off mysql before you go messin' with the data files.
share|improve this answer
1  
And, I can't jab enough that you should run backups on ec2. It's designed to be non-persistent storage. EBS only gives us a safety net that we shouldn't rely on. I suggest mounting your datadir in it's own ebs volume and snapshotting it with a cron. It's stupid easy to do. (admin jab over) –  coteyr Dec 3 '12 at 22:46
    
ec2-create-snapshot -K $KEY -C $CERT -d \"`date`\" $vol in a cron should do the trick to create backups. -- $vol should be the volume id. –  coteyr Dec 3 '12 at 22:50
    
Thank you - the snapshot was done. The backups were being run, BUT NOT UPLOADED TO S3!!!! This wasn't actually the answer - what I did was start a new instance, empty the /opt/bitnami dir and mount there. But thanks for the tips, they did help. And the admin jab was definitely in place. –  hgolov Dec 4 '12 at 9:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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