2

MySQL was not starting. I backed up /var/lib/mysql/*. I uninstalled MySQL and reintalled it. It started again. I copied everything back to /var/lib/mysql. I restarted the service. I logged in and could see all of my tables. When I try to view their contents, I get:

Table 'tablename' doesn't exist

Is there something I need to do to make MySQL recognize the files I copied back into the /var/lib/mysql/ folder?

Any help is appreciated, I'm dying here.

1 Answer 1

4

Check permissions, make sure ownership and permissions are correct on /var/lib/mysql. This is typically mysql. If this is not the issue, produce output of your .err log file.

Try the following to correct permissions:

chown -R mysql:mysql /var/lib/mysql find /var/lib/mysql -type d -exec chmod 770 {} \; find /var/lib/mysql -type f -exec chmod 660 {} \; 

The error log is located in the data directory, which appears to be /var/lib/mysql in your case. Verify in your cnf file.

4
  • I ran chmod -R 777 /var/lib/mysql/ and still had the same problem. Where is the mysql error log located in a standard Ubuntu install? Commented Sep 21, 2010 at 20:56
  • Bad idea, should almost never have public writable stuff. Check out my edit. Commented Sep 21, 2010 at 21:13
  • Thanks for the tweak on permissions. On closer inspection I found that some of my tables existed, and others didnt. Looks like data corruption killed the tables that weren't being found.I found a backup of everything and reimported the data from the backup (thank goodness!). Commented Sep 21, 2010 at 21:19
  • I'm glad everything worked out! Commented Sep 21, 2010 at 22:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.