我是用root登陆,在sqlyog界面操作
1.新建用户
mysql>flush privileges;
完成
2.为用户授权。
无密码时:grant all privileges on cnapsg2.* to root2@localhost;
flush privileges;
3.删除用户。
delete from mysql.user whereUser="root2" and host="localhost";
4.修改指定用户密码。
update mysql.user set password=password('defg') where User="root2" and Host="localhost";
flush privileges;
1.新建用户
不设置密码:insert into mysql.user(Host,User) values("localhost","root2");
设置密码:insert into mysql.user(Host,User,Password) values("localhost","root2",password("abcd"));
//刷新系统权限表mysql>flush privileges;
完成
2.为用户授权。
无密码时:grant all privileges on cnapsg2.* to root2@localhost;
有密码时:grant all privileges on cnapsg2.* to root2@localhost identified by 'abcd';
flush privileges;
完成
部分授权:
grant select,update on cnapsg2.* to root2@localhost identified by 'abcd';flush privileges;
3.删除用户。
delete from mysql.user whereUser="root2" and host="localhost";
4.修改指定用户密码。
update mysql.user set password=password('defg') where User="root2" and Host="localhost";
flush privileges;