User Tools

Site Tools


hyu:mysql_grant
shell> mysql --user=root mysql
 
If you have assigned a password to the root account, you also need to supply a --password or -p option for this mysql command and also for those later in this section.
 
After connecting to the server as root, you can add new accounts. The following statements use GRANT to set up four new accounts:
 
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
    ->     IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';
hyu/mysql_grant.txt · Last modified: 2006/06/03 04:56 (external edit)