By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,273 Members | 1,037 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,273 IT Pros & Developers. It's quick & easy.

"table is read only" after copying table files to new server

P: n/a
I'm trying to port my MySQL tables for a database called "tracerlock" from
one server to another. On the old server, in the /var/lib/mysql/tracerlock
directory, there was a ".MYD", ".MYI" and ".frm" file for every table in
the database. So after creating a database called "tracerlock" on the new
server, I copied these files over to the /var/lib/mysql/tracerlock
directory on the new server. On both servers, all the table files are
owned by user "mysql" in the "mysql" group.

Now, when I connect to MySQL on the new machine and load the tracerlock
database, "show tables" shows all the tables as expected, and I can perform
SELECT statements on them and get the correct results. But when I try
doing INSERT statements on one of the tables that was copied over, I get:

mysql> INSERT INTO test VALUES(3);
ERROR 1036: Table 'test' is read only

However, if I create a new table called test2, I can perform INSERT
statements on it with no error:

mysql> insert into test2 values(3);
Query OK, 1 row affected (0.00 sec)

The files corresponding to test and test2 have the same permissions and
ownership, so that's not it:
-rw-rw---- 1 mysql mysql 20 Aug 15 21:22 test.MYD
-rw-rw---- 1 mysql mysql 1024 Aug 15 21:22 test.MYI
-rw-rw---- 1 mysql mysql 8556 Aug 15 21:22 test.frm
-rw-rw---- 1 mysql mysql 5 Aug 16 19:13 test2.MYD
-rw-rw---- 1 mysql mysql 1024 Aug 16 19:13 test2.MYI
-rw-rw---- 1 mysql mysql 8556 Aug 16 19:13 test2.frm

So how do I get rid of the error that "Table 'test' is read only"?


(425) 497 9002
MySQL General Mailing List
For list archives:
To unsubscribe:***********

Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.