mysql建立使用者

2022-03-06 17:57:31 字數 791 閱讀 3373

grant

all privileges

on*.*

to username@'

%' identified by "password"

分配遠端username所有庫的訪問許可權。

任何資料庫的任何表到使用者username使用密碼password。

1

grant

all privileges

on test_db.*

to [email protected] identified by "password"

2grant

all privileges on test_db.*

to [email protected].% identified by "password"

3grant

all privileges on test_db.*

to [email protected]

/10 identified by "password"

很明顯,第一句是分配使用者user1只能在192.168.1.3上訪問。第二句是在192.168.1網段內都能訪問。第三句是ip  0-10  範圍內的。

刪除使用者:

delete

from

user

where

user

="username" and host="localhost";

最後別忘了這句.

flush privileges;

mysql 建立使用者指令碼 Mysql使用者建立指令碼

我試圖自動化mysql使用者建立過程。我想到建立乙個包含mysql使用者建立語句的臨時檔案,那麼我會這樣稱呼 mysql u root proot 這裡是我的臨時檔案的內容 drop database if exists mytestdatabase create database mytestda...

mysql 建立使用者

mysql grant all privileges on to root identified by with grant option query ok,0 rows affected 0.02 sec 表示是所有的外部機器,如果指定某一台機,就將 改為相應的機器名 mysql grant al...

MYSQL 建立使用者

一,建立使用者 命令 create user username host identified by password 說明 username 你將建立的使用者名稱,host 指定該使用者在哪個主機上可以登陸,如果是本地使用者可用localhost,如果想讓該使用者可以從任意遠端主機登陸,可以使用萬...