ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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;
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.
: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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.