LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-05-2002, 05:22 PM   #1
Cyth
Member
 
Registered: Mar 2001
Location: Sweden, Lund
Distribution: Slackware
Posts: 68

Rep: Reputation: 15
MySql: Table 'X' marked as read only


Hi all,

I have an Visual Basic program connected to an MySql database via ADO which in turn uses MyOdbc.
The MySql database is running separetly on a slack box. The Visual Basic program is running on a Windows 2000 Pro client with Sp2 installed.

When I send a simple UPDATE query it returns "Table 'X' marked as read only" where X is the name of the table.

I haven't marked the table as read only, nor any other weird options. Besides, INSERT statmens works flawless.

I tried to let google guide me, but with no success.

Anyone with experience on this matter?

regards,
Cyth
 
Old 01-05-2002, 06:35 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Check to make sure that your db user has Update-priv permission in the mysql.db table.
 
Old 01-05-2002, 07:46 PM   #3
Cyth
Member
 
Registered: Mar 2001
Location: Sweden, Lund
Distribution: Slackware
Posts: 68

Original Poster
Rep: Reputation: 15
Yupp, the user got full permissions.

/Cyth
 
Old 01-07-2002, 01:57 AM   #4
Cyth
Member
 
Registered: Mar 2001
Location: Sweden, Lund
Distribution: Slackware
Posts: 68

Original Poster
Rep: Reputation: 15
I looked at it more deeply and found out that I was wrong;

A previous user that I used on the mysql db had all previliges but not the one I use now. So I tried to change the Update_priv column by editing the mysql.user table manually with bin/mysql. When I did that with root, it told me "table user is read only".
I am root, and the actual files have write permissions. What am I doing wrong?

I think the two problems is related in some way..

regards,
Cyth
 
Old 01-07-2002, 11:04 AM   #5
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
MYSQL doesn't care if you're root, mysql permissions are granted by mysql not by the system. Try restarting mysqld with the grant tables off mysqld --skip-grant-tables then login as root and flush the privilege table and then provide new privileges to the users as they should be.
 
Old 01-09-2002, 02:15 PM   #6
Cyth
Member
 
Registered: Mar 2001
Location: Sweden, Lund
Distribution: Slackware
Posts: 68

Original Poster
Rep: Reputation: 15
Now I've changed the Update_priv to Y but I _still_ don't have access, I get the same error.

Yes, I have restarted the mysql server and I have checked that my change was still there.

Funny..

A fast answer is *really* appreciated,
Cyth
 
Old 01-09-2002, 02:30 PM   #7
Cyth
Member
 
Registered: Mar 2001
Location: Sweden, Lund
Distribution: Slackware
Posts: 68

Original Poster
Rep: Reputation: 15
mysql> select user, Update_priv from user;
+------+-------------+
| user | Update_priv |
+------+-------------+
| root | Y |
| root | Y |
| | N |
| | N |
| gun | Y |
+------+-------------+
5 rows in set (0.00 sec)

mysql>
I changed the user perms like this:

GRANT ALL PRIVILEGES ON hotel.* TO gun@"%" IDENTIFIED BY ":P" WITH GRANT OPTION;

Hope this helps,
Cyth
 
Old 01-17-2002, 01:19 PM   #8
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
Try restarting mysqld with the grant tables off mysqld --skip-grant-tables then login as root and flush the privilege table and then provide new privileges to the users as they should be.
 
Old 09-07-2004, 09:57 PM   #9
catlion
LQ Newbie
 
Registered: Sep 2004
Distribution: Slackware 9.1
Posts: 6

Rep: Reputation: 0
For those who need to solve this problem

Code:
chown mysql:mysql /var/lib/mysql/mysql/*
. Note that mysql:mysql is user/group which is your server works under, and /var/lib/mysql is the Root path in your my.cnf
 
Old 07-12-2011, 11:20 AM   #10
oobx
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by catlion View Post
For those who need to solve this problem :D

Code:
chown mysql:mysql /var/lib/mysql/mysql/*
:D :D. Note that mysql:mysql is user/group which is your server works under, and /var/lib/mysql is the Root path in your my.cnf
Your post triggered another question about permissions in my head. Thank you, seven years later!

These days, you also need to watch out for SELinux. On my RHEL box, I needed the context to be user_u:object_r:mysqld_db_t. Use chcon to change contexts.
 
Old 07-12-2011, 12:09 PM   #11
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
It's interesting that a post 2.5 years too late can be useful 7 years later! You should start a new thread.
Kevin Barry

Last edited by ta0kira; 07-12-2011 at 12:10 PM.
 
  


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
Re-read Partition Table sourceman Linux - General 11 01-10-2008 04:31 AM
mysql 'user' table read-only fuelinjection Linux - General 2 06-13-2004 09:05 AM
MySQL non-realtime table-by-table mirroring Passive Linux - Software 1 01-20-2004 12:11 PM
How to import MS ACCESS Table including OLE filed into the MySQL Table ? myunicom Linux - General 1 11-28-2003 11:30 AM
deleted mysql table in mysql now cant do anything nakkaya Linux - Software 0 03-18-2003 06:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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