时间:2021-07-01 10:21:17 帮助过:21人阅读
mysql -uroot -p123456
select user();
\c
help create user;
create user ‘0bug‘@‘%‘ identified by ‘123456‘; # 所有人都能登录 create user ‘user192‘@‘192.168.32.*‘ identified by ‘123456‘; # 指定网段的人可以登录
mysql -u0bug -p123456 -h192.168.11.25
all privileges可简写成all ,赋给0bug所有库下的所有表权限
grant all privileges on *.* to ‘0bug‘@‘%‘; flush privileges; # 刷新
grant all on *.* to ‘lcg‘@‘%‘ identified by ‘123456‘;
mysqladmin -uroot -p123456 password 123
tasklist |findstr mysql # 查看进程 tskill mysqld # 通过进程名杀死进程 taskkill -f /PID 12532 # 通过进程pid杀死进程
杀死mysqld--->启动mysqld跳过授权表,登录root用户后更新密码
tasklist |findstr mysql taskkill -f /PID 10176 另起终端登录root用户更改密码: mysql -uroot -p update mysql.user set password=password(‘123123‘) where user=‘root‘ and host=‘localhost‘; flush privileges;
重温MySQL
标签:查询 grant 11.2 highlight password gpo pytho min create