Page 1 of 1

Database User

PostPosted: 23. January 2008 00:20
by BobbyS
I cannot seem to figure out how to set an existing user to a new database. I wouldn't think I would have to create a new user to put with a new database would I?

Thanks

PostPosted: 23. January 2008 00:40
by sari42
GRANT ALL PRIVILEGES ON `somedb`.* TO 'someuser'@'somehost' WITH GRANT OPTION ;

(see http://dev.mysql.com/doc/refman/5.0/en/grant.html )

cheers

PostPosted: 23. January 2008 00:54
by BobbyS
ok I went in to user overview and selected the grant box and it added that user to global and to my new database. Thanks a bunch!! :D

PostPosted: 23. January 2008 01:03
by Izzy
BobbyS wrote:ok I went in to user overview and selected the grant box and it added that user to global and to my new database. Thanks a bunch!! :D
Not a good idea to give any single user, other than the super user root, global privileges.

This database user should have privileges for the database you set only - best practices learned now will be of benefit regarding security in the future.

PostPosted: 23. January 2008 05:10
by BobbyS
Thanks Izzy. I got to thinking and came up with the same conclusion.