MySQL

From Briki
Revision as of 17:23, 22 June 2006 by Andrew (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Assigning passwords to users

Login to mysql as the relevant user and run:

SET PASSWORD = PASSWORD('biscuit');

Creating new users

Login to mysql as root, and run:

GRANT ALL ON database.* TO myuser@localhost IDENTIFIED BY 'password';

Or, to create a user with no password:

GRANT ALL ON database.* TO myuser@localhost;

Obviously, different privileges can be assigned to databases and tables. To revoke privileges, the syntax is:

REVOKE ALL ON database.* FROM myuser@localhost;