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';
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章