Additions:
You can add users right using GRANT
Add User (usage only, all privs, full rights)
mysql> GRANT USAGE ON * . * TO 'myuser'@'myhost' ;
mysql> GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' ;
mysql> GRANT ALL PRIVILEGES ON * . * TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' WITH GRANT OPTION ;
You can remove users rights using REVOKE
Remove User (usage only, all privs, full rights)
mysql> revoke all on * . * from 'myuser'@'myhost' ;
REFERRERS
MySqlAdministration
Deletions:
You can add users using GRANT
Add User (usage only, all privs, full rights)
mysql> GRANT USAGE ON *.* TO 'myuser'@'myhost' ;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' ;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' WITH GRANT OPTION ;
Additions:
Add User (usage only, all privs, full rights)
mysql> GRANT USAGE ON *.* TO 'myuser'@'myhost' ;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' ;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' WITH GRANT OPTION ;
Deletions:
Add User
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' WITH GRANT OPTION;
Additions:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'myhost' IDENTIFIED BY 'newpass' WITH GRANT OPTION;
mysql> UPDATE user SET password = PASSWORD('newpass') WHERE user = 'user' ;
Deletions:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' IDENTIFIED BY 'newpassword' WITH GRANT OPTION;
mysql> update user set password = PASSWORD('newpass') where user = 'user' ;
MySql User Accounts
You can add users using GRANT
Add User
mysql> GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost' IDENTIFIED BY 'newpassword' WITH GRANT OPTION;
Insert & Flush
You can also insert users but must always flush privileges before changes take effect
mysql> INSERT INTO user VALUES('%','newuser',PASSWORD('newpass'),'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');
mysql> FLUSH PRIVILEGES;
Update Password & Flush
You can also update users but must always flush privileges before changes take effect
mysql> update user set password = PASSWORD('newpass') where user = 'user' ;
mysql> FLUSH PRIVILEGES;