先介紹下環境:
阿里云linux版本:CentOS 7.4 64位
資料庫版本:mysql Ver 14.14 Distrib 5.6.42, for Linux (x86_64) using EditLine wrapper
修改資料庫用戶權限的命令:
GRANT SELECT,DELETE,UPDATE,CREATE,DROP ON *.* TO 你的用戶名@"%" IDENTIFIED BY "你這個賬戶的密碼";
修改指定資料庫權限():
錯誤:Access denied for user 'root'@'%' to database '' 無法修改資料庫表或者配置 可用這條命令
grant all on 資料庫名.* to '用戶名'@'%' identified by '密碼' with grant option;
新建資料庫用戶命令:
CREATE USER '你的用戶名'@'%' IDENTIFIED BY '你的密碼';
洗掉資料庫用戶命令:
DROP USER 你的用戶名@'%';
查詢出資料庫所有用戶
SELECT DISTINCT USER FROM mysql.user;
重啟Mysql命令
systemctl restart mysqld.service
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/206675.html
標籤:其他
