Re: How create a new user in MySQL Server?

From: Date: Tue, 15 Aug 2000 01:48:36 +0000
Subject: Re: How create a new user in MySQL Server?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-2052@lists.php.net to get a copy of this message
Samuel Abreu wrote: > > I need to create a user with access to a certain database!! > For example, a have a database called "samuel", and i need a user who > have access denied for all others database and access just for that > database! > How can i do that? > > ThanX > Samuel Abreu > mouse@baydenet.com.br > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Question is what privileges you wanna give to the user? Usualy you need two users: - databaseadministartor (can create, drop and alter tables and so on) - database regularuser (can only deal with data in the database) so here you go: mysql> grant all on samuel.* to adminuser@localhost identified by 'yourpassword'; and mysql> grant select, insert, update, delete on samuel.* to youruser@localhost identified by 'justpassword'; Syntax: grant [privilege] on [database].[table] (* means all tables) to [user]@[host] identified by '[password]' c ya! Jarek Holgersson -- |¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨| | DECAM AB | |¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨| |tel: +46(0)455-337160 | |cel: +46(0)708-881306 | |fax: +46(0)455-22950 | `¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨'

« previous php.db (#2052) next »