Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL newbie needing help

Status
Not open for further replies.

SLG

MIS
Dec 19, 2001
106
US
I'm a newbie to writing MySQL database or any database for that matter. I have a simple database with one table in it and I want to restrict who can add/delete/modify entries in the table but I want to give all authenticated users view access. I'm running MySQL 5 with PHP5 on Linux/Apache (LAMP).

Can someone point me to a simple database example I can look at or a database already written to accomplish this I can download?

Thanks in advance!
 
Different DB';s will have differecnes on how you do it.

But if you are using mysql, you can use their MYSQL Administrator GUI, and assign permissions through that.

But, if you want to do it the old fashion way:

The basic syntax is:

Code:
GRANT [red]X[/red] ON [blue]Y[/blue] TO [green]Z[/green];

Sya you wanted to give a sepcific user from a specific location just view SELECT access. (which equates to viewing)

Code:
GRANT [red]SELECT[/red] ON [BLUE]dbname.tablename[/BLUE] FOR[green] usera@location.com[/green]

So now that particular user will have select permissions on the specified table.

For for info you can use Mysql's online manual entry for the GRANT statement:





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks, but what I'm looking for is a website that allows view access to authenticated users then another section hidden from the users a place for "admin" users to add/subtract/modify the data and add users. Any suggestions?
 
If you want to restrict it from the website side, then this is the wrong forum. DB's are a back end for websites.

DB's are not used to build websites, they are used to store data, and have websites interact with that data, via a server side language such as PHP or ASP.

You might want to visit the forum for whichever server-side language your server supports, to get help in building the website.

forum434
forum333

Once that is set up, then Granting your users permissions like I showed above will limit what they can do when they connect to it.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thanks, I'll check with the PHP Forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top