Error: table is read-only

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Error: table is read-only

Post by twigletmac »

Currently my company runs PHP and MySQL (3.23.52) on IIS (no we can't change to Apache much as I'd like to). At the beginning of this month we changed hosts and now we're having loads of problems with MySQL. Our previous server had Win NT4 and IIS 4 and the new one has Win2K and IIS 5.

The problems that we are now experiencing are incredibly frustrating and irritating. Firstly, tables can't be overwritten claim that they are in use even when the service has been stopped. Secondly the service crashed this morning and we had to reinstall MySQL (with exactly the same configuration settings as before) to get it going again. Then we could read from the database but not write to it and kept getting 'this table is read-only' errors when we tried. Eventually it decided that it could write as well as read from databases and we don't know why. Searching MySQL's docs and the web hasn't turned anything up and I just can't find anything about this error message. If someone else has experienced this before and/or knows what is causing it and how we can stop it happening you'd save me and my fellow developers a lot of headaches.

I have never had any problems with MySQL before and I'm fairly certain it's most likely something to do with IIS but any suggestions are welcome.

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I have never had any problems with MySQL before and I'm fairly certain it's most likely something to do with IIS but any suggestions are welcome.
Is IIS also responsible for El Niño? ;)
Does this also happen if you switch to php-cgi?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It is PHP cgi. I think it might be the way that our new hosting company have set up security on the server. But 'cause I decided to sleep in today (obviously felt the foreboding) nothing could get sorted until I got here (2 and 1/2 hours after the service crashed). I keep mumbling Linux under my breath...

If anyone knows exactly what permissions are required on Windows 2K to have the MySQL data directory be both read and writeable but not put it at too much risk from the malicious people out there I'd appreciate the help.

Mac
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Oh and Microsoft and their software are responsible for everything bad that happens including global warming and that guy who cut me up on the way to work this morning... :lol: Ok, not likely but they could be...

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

although I'm using apache at least my box here at home is w2k ;)
The account the mysql-service is started with is localsystem (installation default).
I can reproduce the error (table 'xyz' is ready only) by explicitly revoking the write permissions for localsystem (properties of the folder of the database --> security/permission settings [sorry, have a german w2k] --> account SYSTEM --> allowing list and read content, disallowing write permission, others kept blank).
If the account for mysqld has been altered it should apply to this account the same way.
If possible check the settings for the mysql-account, the write permission field must be checked (even if grayed out)
Post Reply