Unix Technical Forum

What's best way to do?

This is a discussion on What's best way to do? within the MySQL forums, part of the Database Server Software category; --> Hi, i wrote a webapplication with mysql database. I the PHP code; i use user 'root' in the mysql_connect ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:15 AM
Pat
 
Posts: n/a
Default What's best way to do?

Hi,

i wrote a webapplication with mysql database. I the PHP code; i use user
'root' in the mysql_connect command.

The user of the application is limited to the application and cannot delete
or alter a table, only update, delete and insert the tables.

Is it a good practise to do so, or is it better to define a "anonymous" user
with limited rights?
Thanks
Pat


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:15 AM
Markus Popp
 
Posts: n/a
Default Re: What's best way to do?

Hi,

best practise would be to create one (or if it's suitable for your
application, more) user(s) whose permissions are tailored to the specific
needs for this applications. I would avoid creating anonymous users, there
are rarely good reasons for that ;-).

Markus



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:15 AM
Dikkie Dik
 
Posts: n/a
Default Re: What's best way to do?

> i wrote a webapplication with mysql database. In the PHP code, i use user
> 'root' in the mysql_connect command.
>
> The user of the application is limited to the application and cannot delete
> or alter a table, only update, delete and insert the tables.
>
> Is it a good practise to do so, or is it better to define a "anonymous" user
> with limited rights?


As Markus said, it is better to create a limited "web" user. If a hacker
somehow gets the account data, he cannot do more than the web user could
do via the page. If you really want to limit the database access and if
your database supports stored procedures, you could define a stored
procedure for every allowed action on the database and grant only
execute rights to the web user.

Best regards
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 07:15 AM
Pat
 
Posts: n/a
Default Re: What's best way to do?

Thanks

"Dikkie Dik" <"' OR 1=1 LIMIT 1-- haha"@haha.com> schreef in bericht
news:dpp7pb$67m$1@news.cistron.nl...
>> i wrote a webapplication with mysql database. In the PHP code, i use user
>> 'root' in the mysql_connect command.
>>
>> The user of the application is limited to the application and cannot
>> delete or alter a table, only update, delete and insert the tables.
>>
>> Is it a good practise to do so, or is it better to define a "anonymous"
>> user with limited rights?

>
> As Markus said, it is better to create a limited "web" user. If a hacker
> somehow gets the account data, he cannot do more than the web user could
> do via the page. If you really want to limit the database access and if
> your database supports stored procedures, you could define a stored
> procedure for every allowed action on the database and grant only execute
> rights to the web user.
>
> Best regards



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 07:15 AM
Pat
 
Posts: n/a
Default Re: What's best way to do?

Thanks

"Markus Popp" <mfp@gmx.li> schreef in bericht
news:43bfe7c8$0$23225$91cee783@newsreader02.highwa y.telekom.at...
> Hi,
>
> best practise would be to create one (or if it's suitable for your
> application, more) user(s) whose permissions are tailored to the specific
> needs for this applications. I would avoid creating anonymous users, there
> are rarely good reasons for that ;-).
>
> Markus
>
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:34 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com