mysql8初始化及账户管理

查看初始密码:grep 'temporary password' mysqld.log

mysql> alter user 'root'@'localhost' identified by '密码';

mysql> update mysql.user set host="%" where user="root";

创建用户:

mysql> create user 'zk'@'%' identified by '密码';

授权

mysql> grant all privieges on * to 'zk'@'%';

grant insert on world.* to '用户名'@'IP地址';

flush privileges;

SHOW GRANTS for szzf; 

删除授权

revoke all privileges from 数据库 to '用户名'@'IP地址';

posted @ 2022-11-01 16:49  zk01  阅读(67)  评论(0编辑  收藏  举报