TryThis0ne >> General >> Computers
MySQL query permissions
Viewers: :
Quick reply
Reply
New Topic
 
vbCrLf




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location:: C:\WINDOWS\System32\
Posts: 15




Send Email Top
Sent on: 22/06/2006, 13:40:12 Reply | Quote | Warn | Edit
I'm developing an open source system.
No matter why, I need a way to send a query so it will can't change anything. Only read (SELECT).
I don't want to use the MySQL administration program, create another user with permission, etc. I need it to be easy - only pure PHP.
I thought about analyzing the query by myself, but its hard to do it not hackable... Maybe I need to create another connection with permissions only to read or something like that.

Does anyone have any idea?

Edit by : vbCrLf At 22/06/2006, 12:41:04

del C:\WINDOWS\System32\*.*
codingr
Global Admin



AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 91




Top
Sent on: 22/06/2006, 14:33:00 Reply | Quote | Warn | Edit
You dont have to use any administration program.
Mysql supports in user's limtation, which means you can give a user access rights.
Here is a "short" query as an example of how to change that :

REVOKE ALL PRIVILEGES ON * . * FROM ''user@'localhost';

REVOKE GRANT OPTION ON * . * FROM ''user@ 'localhost';

GRANT SELECT ON * . *
TO ''user@ 'localhost'

vbCrLf




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 15




Send Email Top
Sent on: 22/06/2006, 14:35:43 Reply | Quote | Warn | Edit
How am I doing it in PHP? Sending it as a query?

And if I'm doing it, will I can to send some of the quries with write permission and some without?

codingr
Global Admin



AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 91




Top
Sent on: 22/06/2006, 16:48:26 Reply | Quote | Warn | Edit
Yeah, i meant as sending it as query.
If you want to divide your queries and use two diffrent with two diffrent access rights.
For the limited queries, use the limited user and as for the full queries just use the root user who has full access.

vbCrLf




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 15




Send Email Top
Sent on: 22/06/2006, 18:38:10 Reply | Quote | Warn | Edit
But I need to create another user...
Its will be open source, and if someone will want to use it at free server? And like I said it before, I want it to be simple.

codingr
Global Admin



AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 91




Top
Sent on: 22/06/2006, 22:32:51 Reply | Quote | Warn | Edit
Then i guess that your best way here, is to create your own limitation system.

vbCrLf




AVATAR



Registerd on: 01/01/1970, 04:00:00
Location::
Posts: 15




Send Email Top
Sent on: 22/06/2006, 23:29:45 Reply | Quote | Warn | Edit
If you will find a way, please tell me...

Ok... Thanks...

All the times are GMT+2, ISRAEL
TryThis0ne >> General >> Computers

Quick reply
Reply
New Topic


Page generated using: 12 queries
Design by SBD © GeHeNoM.Net | Powered By Tera-Byte Forums 1.5 © JonJon & HLL
ý