MYSQYL tables not appearing after import

Hello,

Much appreciated if anyone can help with this. My Fedora 14 crashed so I deployed another profile (Fedora 15). I was able to recover my files, and then copies the MYSQL databases from /damaged/var/lib/mysql to /var/lib/mysql.

I can see the tables in ssh, but they don't show up in phpmyadmin. The websites are not connecting properly to the databases. I have a feeling its an issue with permissions to view the tables, but from what I can tell everything is correct.

I have 4 websites on vhost that are all built on PHP/MYSQL.

Kevin

7 Replies

I don't know fedora well so I can't be sure but I expect that the files should be owned by the user "mysql" so try````
chown -R mysql /var/lib/mysql

That should fix the permissions.

You should also run````
mysqlcheck -A -r

as root to check and repair any tables.

Thanks very much for your quick response. I applied the chown command as you suggested, and then got this response when trying to repair the tables:

mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect

I think this may be getting at the 'root' of the problem. I thought I was logged in as the 'root' user which should allow me to access MYSQL.

Does that make sense?

Thanks again-

Kevin

You will need to specify the mysql root password try

mysqlcheck -A -r -u root -p

it will prompt for the mysql root password if you've forgotten your mysql root password you can reset it by following the instructions here http://dev.mysql.com/doc/refman/5.0/en/ … sions-unix">http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix

Thanks, that worked. It does look like its an issue with ownership of the files. I got this error for just about every table:

Error : Can't change ownership of the file '/var/lib/mysql/originalcyn/wpwpscvariationvaluesassoc.MYD' (Errcode: 1)

status : Operation failed

Since I don't have a fedora box handy I can't say what the permissions should be, try spinning up a second linode, install mysql, create a database then check the permissions, then set the original linode's mysql permissions to the same as the new ones.

thanks again for your suggestions.

I found the permissions are supposed to be 660, while they were set at 600. I successfully changed the permissions, but it looks like the ownership of the tables is set to 'mysql' and group 'root':

-rw-rw–-- 1 mysql root 2048 Nov 9 08:38 josxmapitems.MYI

-rw-rw---- 1 mysql mysql 0 Nov 9 08:38 josxmapitems.TMD

-rw-rw---- 1 mysql root 288 Nov 8 23:16 jos_xmap.MYD

-rw-rw---- 1 mysql root 2048 Nov 9 08:38 jos_xmap.MYI

-rw-rw---- 1 mysql root 9498 Nov 8 23:16 josxmapsitemap.frm

-rw-rw---- 1 mysql root 200 Nov 8 23:16 josxmapsitemap.MYD

-rw-rw---- 1 mysql root 2048 Nov 9 08:38 josxmapsitemap.MYI

-rw-rw---- 1 mysql mysql 200 Nov 9 08:38 josxmapsitemap.TMD

-rw-rw---- 1 mysql mysql 288 Nov 9 08:38 jos_xmap.TMD

This is causing me to get this error when trying to repair the tables (this is an example that comes up with every table)

library2.josadmintoolsacl

Error : Can't find file: './library2/josadmintoolsacl.frm' (errno: 13)

status : Operation failed

library2.josadmintoolsadminiplist

Error : Can't find file: './library2/josadmintoolsadminiplist.frm' (errno: 13)

status : Operation failed

library2.josadmintoolsbadwords

Error : Can't find file: './library2/josadmintoolsbadwords.frm' (errno: 13)

Thanks again for any help you can offer-

Kevin

The error reports it cannot find the files, have you verified they exist? If so what does ls -l on them output? Also do the directories they're kept in have the executable bit enabled i.e. when you do ls -d does it show rwx for the owner?

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct