Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Nov 09, 2011 9:16 am 
Offline
Senior Newbie

Joined: Wed Nov 09, 2011 9:09 am
Posts: 5
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


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 9:22 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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
Code:
chown -R mysql /var/lib/mysql


That should fix the permissions.

You should also run
Code:
mysqlcheck -A -r
as root to check and repair any tables.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 9:32 am 
Offline
Senior Newbie

Joined: Wed Nov 09, 2011 9:09 am
Posts: 5
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


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 9:34 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
You will need to specify the mysql root password try
Code:
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

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 9:40 am 
Offline
Senior Newbie

Joined: Wed Nov 09, 2011 9:09 am
Posts: 5
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/wp_wpsc_variation_values_assoc.MYD' (Errcode: 1)
status : Operation failed


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 9:49 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 11:24 am 
Offline
Senior Newbie

Joined: Wed Nov 09, 2011 9:09 am
Posts: 5
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 jos_xmap_items.MYI
-rw-rw---- 1 mysql mysql 0 Nov 9 08:38 jos_xmap_items.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 jos_xmap_sitemap.frm
-rw-rw---- 1 mysql root 200 Nov 8 23:16 jos_xmap_sitemap.MYD
-rw-rw---- 1 mysql root 2048 Nov 9 08:38 jos_xmap_sitemap.MYI
-rw-rw---- 1 mysql mysql 200 Nov 9 08:38 jos_xmap_sitemap.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.jos_admintools_acl
Error : Can't find file: './library2/jos_admintools_acl.frm' (errno: 13)
status : Operation failed
library2.jos_admintools_adminiplist
Error : Can't find file: './library2/jos_admintools_adminiplist.frm' (errno: 13)
status : Operation failed
library2.jos_admintools_badwords
Error : Can't find file: './library2/jos_admintools_badwords.frm' (errno: 13)


Thanks again for any help you can offer-

Kevin


Top
   
 Post subject:
PostPosted: Wed Nov 09, 2011 1:02 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
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?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group