The Register® — Biting the hand that feeds IT

Feeds

Post: Creating a MySQL User

Deepak Vohra

Creating a MySQL User 

In Examples of good practice, or not...

Also, you should never routinely give users the grant privilege, since this is a gaping security hole, especially in a web application. In most situations, only the MySQL root user needs to have grant privileges.

The MySQL documentation has examples of creating a user other than root which includes granting the Grant option to user.

http://dev.mysql.com/doc/refman/5.0/en/adding-users.html

If GRANT option is not required the GRANT statement to create a MySQL user would be:

GRANT ALL PRIVILEGES ON test TO 'mysql'@'localhost'

IDENTIFIED BY 'mysql'