1.add a new user.
grant:
mysql>grant privileges on databas.table to 'user'@'host' identified by 'prassword'
such as
mysql>grant all privileges on *.* to 'yangsf'@'localhost' identified by '9851326' with grant option;
mysql>grant all privileges on *.* to 'yangsf'@'%' identified by '9851326' with grant option;
mysql>grant select ,insert,delete,update ,create,drop on spirent.* to 'xiaoli'@'%' identified by '9851326';
mysql>grant reload, process on *.* to 'yangsf'@'localhost' identified by '9851326';
mysql>grant usage on *.* to 'xiaozhang'@'localhost' ;
insert:
such as
mysql>insert into user(host,user,password) values('localhost','xiaozhang','');
mysql>flush privileges;
2.delete a user;
mysql>DROP USER user [,user] ....
such as
mysql>drop user 'xiaozhang'@'localhost';
3.Modify the account password.
shell>msqladmin -u user_name -h host_name password 'newPassword'
or
mysql>set password for 'user_name'@'host_name' = password('newPassord');
or
mysql>update user set password =password('newPassord') where host='host_name' and user='user_name';
or
mysql>grant usage on *.* to 'user_name'@'host_name' identified by 'newPassword';
grant:
mysql>grant privileges on databas.table to 'user'@'host' identified by 'prassword'
such as
mysql>grant all privileges on *.* to 'yangsf'@'localhost' identified by '9851326' with grant option;
mysql>grant all privileges on *.* to 'yangsf'@'%' identified by '9851326' with grant option;
mysql>grant select ,insert,delete,update ,create,drop on spirent.* to 'xiaoli'@'%' identified by '9851326';
mysql>grant reload, process on *.* to 'yangsf'@'localhost' identified by '9851326';
mysql>grant usage on *.* to 'xiaozhang'@'localhost' ;
insert:
such as
mysql>insert into user(host,user,password) values('localhost','xiaozhang','');
mysql>flush privileges;
2.delete a user;
mysql>DROP USER user [,user] ....
such as
mysql>drop user 'xiaozhang'@'localhost';
3.Modify the account password.
shell>msqladmin -u user_name -h host_name password 'newPassword'
or
mysql>set password for 'user_name'@'host_name' = password('newPassord');
or
mysql>update user set password =password('newPassord') where host='host_name' and user='user_name';
or
mysql>grant usage on *.* to 'user_name'@'host_name' identified by 'newPassword';