Mysql資料庫設定許可權

2022-05-29 16:06:20 字數 738 閱讀 1588

這裡使用cmd視窗進行許可權設定。

create

database 資料庫名字 default charset=utf8;

select

user,host,password from mysql.user;

# 授權賬號命令:

grant 許可權(create, update等) on 庫.表 to'賬號

'@'host

' identified by'密碼

'# all privileges表示授予所有許可權, %

代表允許所有域的連線

grant

allprivileges

on luffy.*to'

luffy

'@'%

' identified by

'luffy';

# 要是本機連mysql連不上,再新增localhost訪問許可權,本機就可以登入了

>: grant

allprivileges

on luffy.*to'

luffy

'@'localhost

' identified by

'luffy';

# 設定完有許可權限制的賬號後一定要重新整理許可權,如果沒重新整理許可權,該終端無法被通知,當然也可以直接重啟cmd

>: flush privileges;

MySQL建立資料庫並設定許可權

經過前兩天的經驗,先把資料庫設定支援ut8bm4格式 傳送門 建立資料庫webadmin create database webadmin character set utf8mb4 collate utf8mb4 unicode ci 建立使用者webadmin create user webad...

MySQL資料庫設定遠端訪問許可權

1 設定使用者名為root,密碼為空,可訪問資料庫test grant all privileges on test.to root 2 設定使用者名為root,密碼為空,可訪問所有資料庫 grant all privileges on to root 3 設定指定使用者名為liuhui,密碼為空,...

mysql資料庫設定遠端連線許可權

mysql 安裝完畢,本機登入正常,在遠端輸入正確賬號密碼登入連線時報錯如下 遠端ip沒有登入許可權,root使用者預設只能在localhost也就是只能在本機登入,需要設定允許其他ip登入許可權。1.在伺服器內部登入資料庫,然後執行 grant all privileges on to root ...