mysql 8.0.16常用基本命令

常用基本命令

跳过登录验证:

mysqld --console --skip-grant-tables --shared-memory

登录数据库:

mysql -u 用户名 -p

创建用户:

create user '用户名' @' %';

给用户授予权限

grant all privileges on *.* to 'root'%';

刷新权限

flush privileges;

误删root用户后添加root用户

insert into user set user='root',ssl_cipher='',x509_issuer='',x509_subject='';

查询用户名及访问地址

select host,user from mysql.User;

修改密码

alter user'root'@'%' IDENTIFIED BY '111111';

猜你喜欢

转载自blog.csdn.net/weixin_42653522/article/details/103299028