MySql User Accounts


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' ;


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;



REFERRERS
MySqlAdministration
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki