LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 10-16-2005, 10:40 PM   #1
laguna01
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Rep: Reputation: 0
Unable to delete files of MySQL


Hi all!

I am trying to remove MySQL 3.23 in order to install MySQL 4.1 on Linux AS3.0. The problem is after I uninstalled the old version, I cannot update or insert to some tables of the database 'mysql'. Below is the list of tables:

columns_priv
db
func
host
tables_priv
user

For example, everytime I tried to insert or update the table user, I always got the following message:

"ERROR 1036 (HY000): Table 'user' is read only"

I thought that it might be something wrong with the file access permission but when check that with ls -Al under the folder /var/lib/mysql/mysql , Linux shows me below info:

-rw------- 1 mysql root 8778 Jun 7 14:36 columns_priv.frm
-rw------- 1 mysql root 0 Jun 7 14:36 columns_priv.MYD
-rw------- 1 mysql root 1024 Jun 7 14:36 columns_priv.MYI
-rw------- 1 mysql root 8982 Jun 7 19:34 db.frm
-rw------- 1 mysql root 453 Jun 13 14:09 db.MYD
-rw------- 1 mysql root 3072 Jun 13 14:11 db.MYI
-rw------- 1 mysql root 8641 Jun 7 14:36 func.frm
-rw------- 1 mysql root 0 Jun 7 14:36 func.MYD
-rw------- 1 mysql root 1024 Jun 7 14:36 func.MYI
-rw------- 1 mysql root 8958 Jun 7 14:36 host.frm
-rw------- 1 mysql root 0 Jun 7 14:36 host.MYD
-rw------- 1 mysql root 1024 Jun 7 14:36 host.MYI
-rw------- 1 mysql root 8877 Jun 7 14:36 tables_priv.frm
-rw------- 1 mysql root 0 Jun 7 14:36 tables_priv.MYD
-rw------- 1 mysql root 1024 Jun 7 14:36 tables_priv.MYI
-rw------- 1 mysql root 9148 Jun 7 14:36 user.frm
-rw------- 1 mysql root 1926 Jun 14 15:00 user.MYD
-rw------- 1 mysql root 2048 Jun 14 16:40 user.MYI

Since I login as root, file permission should not be a problem but I still tried to change it with chmod and below is what I always get:

chmod: changing permissions of `user.MYI': Operation not permitted

I then tried to remove the file user.MYI manually by using rm Ėf user.MYI but failed:

rm: cannot remove `user.MYI': Operation not permitted

I donít understand why I cannot do it even I logon as root user. It looks like something has locked down these files and even MySQL cannot access to them. That is why MySQL think these files are readonly, I guest. Could anyone please give me some hints to solve this problem?

Any feedback is appreciated

Regards

Adrian Mai
 
Old 10-17-2005, 03:06 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Did you run the upgrade scripts to convert the databases?
 
Old 10-17-2005, 08:20 PM   #3
laguna01
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by david_ross
Did you run the upgrade scripts to convert the databases?
Yes, I did but I received the error messages saying that these tables is readonly.
 
Old 10-19-2005, 12:12 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Is the filesystem mounted as readonly? What do you get from running "mount"?
 
Old 10-20-2005, 04:31 AM   #5
laguna01
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by david_ross
Is the filesystem mounted as readonly? What do you get from running "mount"?
Hi david_ross, here is what I got from running "mount":

[root@test /]# mount
/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)


I dont really understand what does that mean, any clue?

Thanks
 
Old 10-20-2005, 12:22 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
The rw means it is mounted as read/write. I'm surprised it's doing this. Can you create new files in that directory:
date > /var/lib/mysql/mysql/date.test
cat /var/lib/mysql/mysql/date.test
rm -f /var/lib/mysql/mysql/date.test

Does that create a file with the date and then delete it ok?
 
Old 10-20-2005, 12:43 PM   #7
KimVette
Senior Member
 
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794

Rep: Reputation: 46
Two things:

1. To rule out file ownership could you chown -R the mysql directories? (You can always chown them back to mysql if necessary)
2. You're on ext3, which supports the immutable attribute. Can you create a link to that file? If no: You happen happen to have that bit set. In such cases, even root cannot delete the file until that bit is unset. (man chattr)
 
Old 10-21-2005, 04:51 AM   #8
laguna01
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by KimVette
Two things:

1. To rule out file ownership could you chown -R the mysql directories? (You can always chown them back to mysql if necessary)
2. You're on ext3, which supports the immutable attribute. Can you create a link to that file? If no: You happen happen to have that bit set. In such cases, even root cannot delete the file until that bit is unset. (man chattr)

Hi KimVette and david_ross

I think KimVette are right, I unset the immutable attribute for the whole mysql folder and now I can delete it. It's really interesting and now I can have MySQL on my server, thank you very much for your helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete files via php on Linux burnham Linux - Newbie 6 05-26-2005 08:56 AM
MySQL - Warning: mysql_result(): Unable to jump to row 0 on MySQL result index 9 jasontn Linux - Software 0 02-09-2005 12:17 PM
Unable to delete folder arctuniol Red Hat 2 10-11-2004 02:07 PM
Unable to delete trash entropyv Mandriva 1 09-26-2004 11:29 AM
I am unable to delete my post MOZ LQ Suggestions & Feedback 1 01-19-2002 04:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration