long story short I am restoring a failed server. I have a backup of most of the file system. I need to restore the SQL databases but I don't have a copy of the mysqldump. so I've restored the files to /var/lib/mysql. But when I try to view the tables the database is empty.

Can this be done? And what other steps do I need to take? at the very least can I mount this DB somewhere where I can read the data and recreate the pages and articles?

Ubuntu 18.04

  • can this be done and how? ill put it in an edit. – Derek Frelow Jan 10 at 16:10
  • The transfered tables are an empty set. I only moved the folders with the names of the tables. should I move the whole mysql folder? – Derek Frelow Jan 10 at 17:34
  • The whole /var/lib/mysql folder, yes. I thought you had done that since you've stated it in your question. – slhck Jan 10 at 19:16
  • so now im getting this error when starting mysql. mysql.service - MySQL Community Server Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2019-01-10 19:39:00 UTC; 15s ago Process: 3089 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid (code=exited, status=1/FAILURE) Process: 3067 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS) im sorry the formating looks horrible here. – Derek Frelow Jan 10 at 19:41
  • Please just edit the question to include any additional info. – slhck Jan 10 at 20:05

Thanks to @slhck!

The solution was not to copy the entire mysql folder but just the folder of the databases you need (in my case DerekFrelow_com) the thing I forgot to do was change my permissions on the folder.

I noticed the more comments we had the more relevant the "related Links got" so here is the source that gave me the ah-ha moment.

Import or restore MySQL databases from var directory

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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