LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-01-2003, 08:01 PM   #1
don_dimo
Member
 
Registered: Oct 2003
Location: Blacksburg, VA
Distribution: Fedora Core 2 (kde)
Posts: 144

Rep: Reputation: 15
Mysql insert problem


Hi,

Does anyone know how to modify table properties in mysql??? I just tried add a new entry to one of my tables and it gives the error:

ERROR 1036: Table 'blah' is read only

I am addiing it as root, i have corret privileges, table files have rwx for all users... i dont know what else to check??
Can anyone help me?
Thanks
 
Old 11-01-2003, 08:38 PM   #2
rubyrat
LQ Newbie
 
Registered: Sep 2003
Location: Leeds, UK
Distribution: Debian, Redhat, Mandrake, Gentoo
Posts: 16

Rep: Reputation: 0
Your mysql user (usually mysql) may be unable to write to the database, find where your mysql database files are and make sure that mysql user has rwx on the directory and rw on all the files and that the files are OWNED by mysql - chown them. Remove the other privileges e.g. chmod 660 and also make the directories 700 only mysql and root needs to go there.

There is also a problem noted on the mysql site:

"Charles Gregory: If you encounter "ERROR 1036: Table 'xxx' is read only", this may be due to a corrupt internal setting in MySQL. This can occur if, for example, you upload a new table from a Windows-based MySQL database directly to a Linux/Unix database. The solution is to use 'dumpmysql' to dump the databases, THEN be sure to DROP TABLE for the 'read only tables' or the internal config will not be properly reset! Deleting the table files is not sufficient. Once the tables are dropped, feed the dump file back to mysql, and it will create the tables anew, and they will be writable."
 
Old 11-01-2003, 09:04 PM   #3
don_dimo
Member
 
Registered: Oct 2003
Location: Blacksburg, VA
Distribution: Fedora Core 2 (kde)
Posts: 144

Original Poster
Rep: Reputation: 15
Thx for the reply rubyrat, but as I said I have the permission and the ownership for the files correct.
It is most probably an internal setting problem in mysql as your post said I will try the mysqldump, do u know what is meant by "feed the dump file back to mysql" though cause I dont wonna lose my table files after dropping the tables.
 
Old 11-01-2003, 09:27 PM   #4
rubyrat
LQ Newbie
 
Registered: Sep 2003
Location: Leeds, UK
Distribution: Debian, Redhat, Mandrake, Gentoo
Posts: 16

Rep: Reputation: 0
you can test by specifying a different database

mysql -u username -p MYNEWDATABASENAME < mysqldumpfile

Read all about it at http://www.sitepoint.com/print/678 they do a good guide.

As for the permissions sorry but you gave me the impression you were running mysql databases in directories set 777 (rwx rwx rwx) and files to 666 (rw- rw- rw-) mode.

Last edited by rubyrat; 11-01-2003 at 09:29 PM.
 
  


Reply



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
segmentation fault when insert data into mysql torontosmallbird Other *NIX 1 08-07-2005 07:13 AM
php mysql insert null value spoody_goon Programming 2 03-28-2004 10:20 AM
I need to insert and post PHP MYSQL DropHit Programming 2 02-18-2004 11:21 PM
Why MySQL Error on INSERT INTO....? pnh73 Programming 2 11-01-2003 05:53 PM
Insert Data by FORM in MYSQL gruger Linux - Software 0 07-16-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:29 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
Open Source Consulting | Domain Registration