centos Mysql許可權設定

2021-08-14 22:22:46 字數 1396 閱讀 7811

ps:通過分配相對應的許可權來運算元據庫

關於安裝mysql 請前往

1.安裝完成root即為管理員

圖示即為一般使用者非超級管理員

新建立和root許可權使用者差別對比。

2.建立的使用者分配許可權

在以下操作前(用root使用者登入資料庫)

mysql>use

mysql;

建立超級使用者

mysql>grant all privileges on*.

*to'username'@'%' identified by

'password'

with grant option;

mysql>flush privileges;重新整理系統許可權

刪除使用者

mysql> delete from user where user='admin'

and host='%';

mysql> flush privileges;

建立有許可權的使用者

grant select,insert,update,delete on news.* to

'admin'@'192.168.1.*' identified by

'admin002'

with grant option;

mysql> flush privileges;

驗證,許可權設定成功

已存在使用者許可權分配

grant

allprivileges

on *《資料庫》.*《表名》 to

'user'@localhost identified by

"password" ;

grant

all《所有操作》

//分配對應的操作

grant

insert,select,update,delete

on《同上》

'user'

@localhost

'user'

@'%'

'user'

@'《指定ip>'

mysql 許可權設定 mysql 許可權設定

關於mysql的使用者管理,筆記 1 建立新使用者 通過root使用者登入之後建立 grant all privileges on to testuser localhost identified by 123456 建立新使用者,使用者名為testuser,密碼為123456 grant all ...

Centos mysql忘記密碼

首先開啟配置檔案 vim etc my.cnf 在裡面加上 skip grant tables 重啟mysql 服務 systemctl restart mysqld.service 登入mysql 連續回車,進入 mysql u root p use mysql 修改密碼 update user ...

centos mysql修改密碼

一 修改配置檔案 1 vim etc my.cnf 2 新增skip grant tables 3 重啟mysql sudo service mysqld restart 如下圖 二 登入mysql 1 mysql uroot p 2 輸入密碼登入 3 use mysql 4 更新root使用者資訊...