1. 程式人生 > >mysql 使用者管理和許可權設定和Mysql初始化root密碼和允許遠端訪問

mysql 使用者管理和許可權設定和Mysql初始化root密碼和允許遠端訪問

grant 普通資料使用者,查詢、插入、更新、刪除 資料庫中所有表資料的權利。

grant select on testdb.* to [email protected]’%’

grant insert on testdb.* to [email protected]’%’

grant update on testdb.* to [email protected]’%’

grant delete on testdb.* to [email protected]’%’

或者,用一條 MySQL 命令來替代:

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

[email protected]’%’

9>.grant 資料庫開發人員,建立表、索引、檢視、儲存過程、函式。。。等許可權。

grant 建立、修改、刪除 MySQL 資料表結構許可權。

grant create on testdb.* to [email protected]’192.168.0.%’;

grant alter on testdb.* to [email protected]’192.168.0.%’;

grant drop on testdb.* to [email protected]’192.168.0.%’;

grant 操作 MySQL 外來鍵許可權。

grant references on testdb.* to [email protected]’192.168.0.%’;

grant 操作 MySQL 臨時表許可權。

grant create temporary tables on testdb.* to [email protected]’192.168.0.%’;

grant 操作 MySQL 索引許可權。

grant index on testdb.* to [email protected]’192.168.0.%’;

grant 操作 MySQL 檢視、檢視檢視原始碼 許可權。

grant create view on testdb.* to

[email protected]’192.168.0.%’;

grant show view on testdb.* to [email protected]’192.168.0.%’;

grant 操作 MySQL 儲存過程、函式 許可權。

grant create routine on testdb.* to [email protected]’192.168.0.%’; -- now, can show procedure status

grant alter routine on testdb.* to [email protected]’192.168.0.%’; -- now, you can drop a procedure

grant execute on testdb.* to [email protected]’192.168.0.%’;

10>.grant 普通 DBA 管理某個 MySQL 資料庫的許可權。

grant all privileges on testdb to [email protected]’localhost’

其中,關鍵字 “privileges” 可以省略。

11>.grant 高階 DBA 管理 MySQL 中所有資料庫的許可權。

grant all on *.* to [email protected]’localhost’

12>.MySQL grant 許可權,分別可以作用在多個層次上。

1. grant 作用在整個 MySQL 伺服器上:

grant select on *.* to [email protected]; -- dba 可以查詢 MySQL 中所有資料庫中的表。

grant all on *.* to [email protected]; -- dba 可以管理 MySQL 中的所有資料庫

2. grant 作用在單個數據庫上:

grant select on testdb.* to [email protected]; -- dba 可以查詢 testdb 中的表。

3. grant 作用在單個數據表上:

grant select, insert, update, delete on testdb.orders to [email protected];

4. grant 作用在表中的列上:

grant select(id, se, rank) on testdb.apache_log to [email protected];

5. grant 作用在儲存過程、函式上:

grant execute on procedure testdb.pr_add to ’dba’@’localhost’

grant execute on function testdb.fn_add to ’dba’@’localhost’

注意:修改完許可權以後 一定要重新整理服務,或者重啟服務,重新整理服務用:FLUSH PRIVILEGES。

相關推薦

mysql 使用者管理許可權設定Mysql初始root密碼允許遠端訪問

grant 普通資料使用者,查詢、插入、更新、刪除 資料庫中所有表資料的權利。 grant select on testdb.* to [email protected]’%’ grant insert on testdb.* to [email protected]’%’ grant

Mysql初始root密碼允許遠端訪問(Ⅱ)

1、初始化root密碼 進入mysql資料庫 1 mysql>update user set password=PASSWORD(‘123456’) where User='root'; 2、允許mysql遠端訪問,可以使用以下三種方式: a、改表。 1 2 3

oracle預設初始使用者名稱密碼密碼修改

安裝Oracle時,若沒有為下列使用者重設密碼,則其預設密碼如下: 使用者名稱 / 密碼 登入身份 說明 sys/change_on_install SYSDBA 或 SYSOPER 不能以 NORMAL 登入,可作為預設的系統管理員 sy

mysql 使用者管理許可權設定

使用者管理 mysql>use mysql; 檢視 mysql> select host,user,password from user ; 建立 mysql> create user  test   IDENTIFIED by 'xxxxx'

centos7下mysql 使用者管理許可權設定

1.進入mysql命令列,輸入root及密碼 [[email protected] ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or

Ubuntu 環境下的mysql 遠端訪問,redis 遠端訪問設定密碼 ,mongo 安裝 ,設定使用者密碼,開啟遠端訪問

MySQL遠端訪問 1.編輯mysql配置檔案,把其中bind-address = 127.0.0.1註釋了 vi /etc/mysql/mysql.conf.d/mysqld.cnf 2.使用root進入mysql命令列,執行如下2個命令,示例中mysql的root賬號密碼:root grant

【itext學習之路】-------(第三篇)對pdf文件進行加密許可權設定

上篇文章,我們學習了pdf的屬性設定,但是我們知道,在實際開發中,如果pdf文件被黑客盜取的話,那麼pdf中的資訊就會被洩露,因此本篇文章將會介紹pdf的加密設定,並且設定許可權。 首先我們要說明的是,itext中對pdf文件的加密包括兩部分,第一部分是使用者密

linux下ssh/sftp配置許可權設定

基於 ssh 的 sftp 服務相比 ftp 有更好的安全性(非明文帳號密碼傳輸)和方便的許可權管理(限制使用者的活動目錄)。 1、開通 sftp 帳號,使使用者只能 sftp 操作檔案, 而不能 ssh 到伺服器 2、限定使用者的活動目錄,使使用者只能在指定的目錄下活動,使用 sftp 的 Chroot

oracle使用者建立、授權許可權設定(關於Oracle許可權2)

許可權: create session create table unlimited tablespace connect resource dba 例: #sqlplus /nolog SQL> conn / as sysdba; SQL>

Mysql 忘記root密碼修改root密碼

一、以下是Windows作業系統的操作步驟: 1. 關閉正在執行的MySQL服務-->net stop mysql 2. 開啟DOS視窗,轉到mysql\bin目錄。 3. 輸入mysqld --console --skip-grant-tables --shared-memory

SSAS cube角色許可權設定問題

1、在SSAS目錄下建立角色,比如test。 在常規裡面點選“讀取”即可,在成員身份裡面輸入你要控制的角色。 2、資料來源,也是“讀取”即可 3、多維資料集是選擇你讓其許可權可以檢視哪些資料集,我這裡就一個,也是讀取。 跳過 單元資料、維度這兩項,可以

MySQL 5.7更改Root密碼Host

mysql5.7 ora edge 所有 var nbsp mysqld http not MySQL5.7對用戶密碼管理對更為嚴格。 為測試方便,需要將root對權限擴大為所有host。具體操作如下: grep ‘temporary password‘ /var/lo

MySQL允許遠端訪問設定

MySQL允許遠端訪問的設定 阿里雲需要在安全組中開放埠! 1.註釋bind-address = 127.0.0.1。 程式碼如下: sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 將bind-address = 127.0.0

Ubuntu設定MySQL允許遠端訪問

1.註釋bind-address = 127.0.0.1。 程式碼如下: > sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf 將bind-address = 127.0.0.1註釋掉(即在行首加#),如下: 程式碼如下: # In

將本地的mysql資料庫設定允許遠端訪問

將本地的mysql資料庫設定為允許遠端訪問 >use mysql; mysql>grant all privileges on *.* to 'root'@'%' with grant&nb

linux下mysql的解除安裝,安裝,忘記密碼修改密碼允許遠端連線的設定

一、linux下mysql的解除安裝        檢視已經安裝了的MySql的包              rpm -qa|grep -i mysql [[email protected] ~]# rpm -qa|grep -i mysql MySQL-c

設定MYSQL允許遠端訪問(navicat訪問報2003:10038錯誤)

當在Navicat for MySQL中填好連線名、ip、埠、使用者名稱、密碼之後,雙擊連線名時報‘2003-Can’t connect to MySQL server on ''xxx’(10038),這是什麼原因導致的呢?需要按照如下兩步進行修改MYSQL

phpstudy設定允許遠端訪問mysql資料庫

1、先在伺服器中通過命令列方式(開啟phpstudy介面->右下角其他選單選項->MySQL工具->MySQL命令列) 登入mysql:mysql   -u root -p 密碼 (如果mysql初始賬號和密碼都是root)   2、執行use mysql;&nbs

現在設定mysql允許遠端訪問

首先執行 先進入cd etc/mysql/mysql.conf.d 下載 sudo apt-get install vim 執行sudo vim mysqld.cnf 註釋掉bind-address = 127.0.0.1: 點選i 會進入插入格式,註釋掉後按ESC鍵退

mysql設定允許遠端訪問

有時mysql拒絕連結,是因為沒有開啟允許遠端連結 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456'      這裡的123456為你給新增許可權使用者設定的密碼,%代表所有主機,也