Advanced

How To Administer User Accounts In Mysql

Posted by cshaw on · Post a comment
Chrstopher Shaw Portfolo; By Christopher Shaw
Mail this story
Print this story

Several commands for adding and modifying users in a mysql database.

When working with a mysql database, you may need to add additional users for many reasons, following is a selection of commands to do this simply.

Change username password,database_name and table_name to the real values.

Create a User

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';

Add All Privileges

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

Reload Privileges

FLUSH PRIVILEGES;

Add Specific Permission

GRANT type_of_permission ON database_name.table_name TO ‘username’@'localhost’;

Remove Specific Permission

REVOKE type_of_permission ON database_name.table_name FROM ‘username’@‘localhost’;

Delete User

DROP USER ‘username’@‘localhost’;

Show Permissions

SHOW GRANTS username;

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Developer, MySQL

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments

No comments yet. Be the first.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post