mysql  创建用户


create user 用户名@主机 identified by password;


例: create user 'my'@'localhost' identified by '123456';


修改密码:

set password for 用户@主机 =password('新密码');


set password for 'my'@'localhost'=password('123456');


分配权限:

 grant privileges on 数据库.表名 to 用户@主机;


 grant all on test.* to 'my'@'localhost'


刷新权限

 flush privileges;