lokie538 Posted December 14, 2008 Share Posted December 14, 2008 Hi, Is there anyway that permissions can be set up for users, per table. In one database I have a few tables, the problem is that I need a user to change one table, but i only want them to be allowed to view the others. Is there anyway to set-up permissions to allow this? Thanks in advance, lokie538 Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/ Share on other sites More sharing options...
lokie538 Posted December 15, 2008 Author Share Posted December 15, 2008 Any thoughts guys? Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-715571 Share on other sites More sharing options...
PFMaBiSmAd Posted December 15, 2008 Share Posted December 15, 2008 Which users are you talking about? The visitors to your site or the user/password/permissions you have assigned to your database? Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-715669 Share on other sites More sharing options...
lokie538 Posted December 16, 2008 Author Share Posted December 16, 2008 The database user accounts that are assigned to the database with mysql. Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-716566 Share on other sites More sharing options...
fenway Posted December 16, 2008 Share Posted December 16, 2008 What's the issue? GRANTs allow this. Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717148 Share on other sites More sharing options...
lokie538 Posted December 17, 2008 Author Share Posted December 17, 2008 So with GRANT I can setup that a user can modify one table in a database, while only being allowed to view another table from the same database? I did a quick search of google and I couldn't see how to do this :/ Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717210 Share on other sites More sharing options...
corbin Posted December 17, 2008 Share Posted December 17, 2008 http://dev.mysql.com/doc/refman/5.1/en/grant.html GRANT ALL ON somedb.sometable1 TO 'corbin'@*; GRANT SELECT ON somedb.sometable2 TO 'corbin'@*; corbin could then do anything to somedb.sometable1, but only select from somedb.sometable2. Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717353 Share on other sites More sharing options...
fenway Posted December 17, 2008 Share Posted December 17, 2008 Don't forget to FLUSH PRIVILEGES. Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717408 Share on other sites More sharing options...
lokie538 Posted December 17, 2008 Author Share Posted December 17, 2008 Ok ill give that a go!! Thanks for all you help guys! Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717414 Share on other sites More sharing options...
lokie538 Posted December 17, 2008 Author Share Posted December 17, 2008 Don't forget to FLUSH PRIVILEGES. What will this do? Remove all the currently set privileges? Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717416 Share on other sites More sharing options...
fenway Posted December 17, 2008 Share Posted December 17, 2008 Nope... it reloads the grant tables so that your changes actually do something. Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717417 Share on other sites More sharing options...
lokie538 Posted December 17, 2008 Author Share Posted December 17, 2008 Ok cool, thanks for the help! Your a legend!! Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717421 Share on other sites More sharing options...
lokie538 Posted December 17, 2008 Author Share Posted December 17, 2008 Omg now I feel retarded, just found you can do this in phpmyadmin. I had a quick look the other day and didnt think you could. hehe Quote Link to comment https://forums.phpfreaks.com/topic/136973-solved-mysql-table-permission-question/#findComment-717423 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.