MySql資料庫使用者的建立,刪除和檢視

2021-07-03 19:36:41 字數 916 閱讀 5550

建立使用者的命令:

mysql> create user yy identified by

'123';

yy表示你要建立的使用者名稱,後面的123表示密碼,上面建立的使用者可以在任何地方登陸。

mysql> create

user

yy@localhost identified by '123'

;

授權:

mysql> grant all privileges on *.* to user;@localhost
grant

select,insert,update,delete

on *.* to test1@"%" identified by

"abc";

grant

select,insert,update,delete

on *.* to test1@"%" identified by

"abc";

格式:grant select on 資料庫.* to 使用者名稱@登入主機 identified by 「密碼」

修改密碼:

mysql> grant   all   privileges   on   pureftpd.

*to koko@localhost identified by

'mimi';

重新整理:

mysql> flush privileges;
檢視使用者資訊:

mysql> select host,user from mysql.user;

mysql建立資料庫,建立使用者

建立資料庫 create database test use test 建立使用者 create user test identified by test 給使用者賦權 grant all on test.to test 建立資料庫 命令 create database databasename 例...

Mysql建立資料庫使用者

通常情況下我們在編寫 的過程中 也就是在開發過程中 一直使用的是我們本地的mysql,而且使用者都是root使用者,最高許可權的使用者,但是我們如果在公司上班的時候,公司的領導不會讓你擁有root許可權,這樣存在風險.這就需要建立普通的使用者.開啟自己的cmd,輸入mysql u root p 輸入...

mysql資料庫的建立與刪除

一 建立資料庫 create if not exists db name default character set charset name 其中,中的部分是必選項,表示二者選其一,中的是可選項。character 部分是對資料庫採用的字符集的設定。1.建立資料庫demo2 關於 if not e...