0

How to set a user to edit and access a specific database table only? is it possible? i am using vb.net and mysql as my database

Redd
  • 3
  • 5
  • 3
    `is it possible` yes. You can use the built in permissions, app logic, views. Again, see [Ask]. – Ňɏssa Pøngjǣrdenlarp Nov 28 '15 at 18:18
  • 2
    Possible duplicate of [Create new user in MySQL and give it full access to one database](http://stackoverflow.com/questions/1720244/create-new-user-in-mysql-and-give-it-full-access-to-one-database) – Timofey Nov 28 '15 at 20:44

2 Answers2

2

If you are talking about mysql user permissions, then you should use:

GRANT SELECT, INSERT ON mydb.mytbl TO 'someuser'@'somehost';

Edit 1 : Adding Resource Links You should consult the MySQL GRANT statement, and Access Privilege System documentation for more information on how this all works.

Rich Seviora
  • 1,789
  • 12
  • 16
Sam Ivichuk
  • 999
  • 1
  • 10
  • 22
0
  • Make a user Table, perhaps called UserAccounts.
  • When login then select username and password from UserAccounts.
  • Make a condition, for username = admin and pass = admin then can do all query.
  • for username = guest and pass = guest then can do only query1.
  • and so on.

Databases and its tables permission, can be done via application based on query. just specified your query and which user should run it

give some code, so we can see your progress

  • I am done with the admin and the user restriction. What i'm trying to do now is i have nhm and scitech table in my database. when nhm user logged on to the system he cannot have access to the scitech table viceversa. – Redd Nov 28 '15 at 18:46
  • Yeah like I said, do the special query for each user. If you doing query by button, then never write another tables for that user. And dont let user except admin choose the databases or tables. – Bondan's Blackk Diamond Nov 28 '15 at 18:53
  • Why wouldn't you recommend the built-in access functions? It seems much much easier than this approach... – Rich Seviora Nov 28 '15 at 21:07