0

I crashed my first Ubuntu installation by changing some distribution stuff (now stuck in login loop, even in shell).

So I installed Ubuntu again on my second hard drive from which I can access the crashed Ubuntu setup.

And since I can't start Apache2 or reach the MySQL server there anymore, I'm wondering if there is a possibility to duplicate the MySQL data just by copying files from one hard drive to another.

Or maybe someone has an alternative idea to restore the MySQL data?

3
  • 1
    Can you do an upgrade or some sort of repair installation onto the original disk to reinstate the system? That won't zero everything out, so the original data may be accessible once more. Commented Jan 28, 2016 at 20:01
  • For now I could restore my database following the answer below. But in the next days I will try to repair my first Ubuntu installation, thank you for your suggestion! Commented Jan 28, 2016 at 21:57
  • Found out (via error log in the root dir) that the bash file in my bin folder was missing. Just copied it from latest Ubuntu installation and finally there's no login loop anymore - no idea how I got it disappear Commented Feb 6, 2016 at 22:16

1 Answer 1

1

You can create a database of the same name on the other computer and then transfer the content of /var/lib/mysql/_dbname_/. Stop before the copying and start after it.

Sign up to request clarification or add additional context in comments.

1 Comment

Caveat: this only works if the tables are MyISAM. It does not work with InnoDB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.