h1

MySQL Create new user and grant commands

January 19, 2012

Make a new database (schema) …


mysql> create schema myschema;
Query OK, 0 rows affected (0.00 sec)

Add a new user …


mysql> create user 'fred'@'localhost' identified by 'password-secret-string';
Query OK, 0 rows affected (0.00 sec)

Let the user have access to the new schema …


mysql> grant all privileges on myschema.* to 'fred'@'localhost';
Query OK, 0 rows affected (0.01 sec)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: