Due to a stupid mistake of mine I had to reload the OS (xubuntu 16.04). Before doing this I backed up /var/lib/mysql folder to a safe place. (I booted up from live CD and was able to access files on the hard disk.) However, now I'm unable to restore my database. After installing the same version of mysql I copied back the backed up /var/lib/mysql folder but then the server fails to start. When I go back and use the original, virgin /var/lib/mysql folder (which I retained in renamed fromat) then I can use the sql server but of course with empty database. I googled and researched answers, but finally resorted to ask for help. Could this be due to some apparmor or other "under-the-hood" peculiarity? Important: my backup is fresh, the newly installed mysql server is the same version of the one prior to the crash. It should work, shouldn't it?
Asked
Active
Viewed 60 times
0
-
you can try removing .err files from your backup and changing ownership on you backup files to `mysql` user – mr_sudaca Sep 28 '16 at 21:57
-
thx for the lookup @KenWhite – Drew Sep 28 '16 at 22:23
-
@KenWhite - Thanks; after I posted this question today I looked into the /var/log/mysql error log and found out that indeed, ownership was A problem (I did not use the rescue copy from the crashed machine carefully and file owners became root) - So I corrected them, BUT still could not start the server. The error aborting start up this time was unknown variable 'key_buffer=16M. Should I start a new question for this? Any directions to proceed? – Janos Sep 30 '16 at 02:38
-
@KenWhite - OK, I figured it out, the problem was using the old configuration file, originally created for my previous installation with 5.5. Now in the rebuilt machine with brand new Ubuntu 16.04 and having downloaded the 5.7 mysql the .cnf file syntax is somewhat different. So the solution was (1) restore file and group ownership according to the initial install of 5.7, and (2) use the initial install 5.7 configuration, not my backed up old configuration file. Now my sql server did start, and my old database is there. Thanks again for the ideas and encouragements. Case closed - Janos – Janos Sep 30 '16 at 03:33