mysql配置管理平台 mysql的安裝配置管理

2021-10-18 02:10:30 字數 3122 閱讀 8214

mysql -u root -p

-u 選項用來指定登入的使用者,後面的root表示採用root帳號登入。-p選項表示採用密碼驗證的方式登入。

在輸入前面的命令後,系統會提示輸入密碼,如果正確的話就可以進入系統了。

3. 建立新使用者

在大多數情況下,如果我們將結合mysql進行一些開發工作的話,不會直接採用root賬戶。一般root賬戶用來做一些系統管理和維護的工作,而且因為root許可權太高。如果mysql系統出現問題容易導致所有資料的破壞。所以我們需要專門建立乙個特定的使用者,由root來給它指派一定的許可權。這樣,就算該賬戶出現問題,造成的損失也可能只是該帳號許可權範圍內的,不至於整體的破壞。

比如說我們要建立乙個新的使用者,並設定該使用者的訪問密碼,在以root使用者登入進入系統後,執行如下命令:

insert into mysql.user(host,user,password) values("localhost","firesnow",password("1234"));

這樣我們就新增了乙個使用者名為firesnow密碼為1234的使用者,但是這個賬戶目前還不能登陸,因為他沒有任何許可權。

刪除使用者

mysql>delete from mysql.user where user="firesnow" and host="localhost";

修改使用者密碼

mysql>update mysql.user set password=password('123456') where user="firesnow" and host="localhost";

4. 配置新使用者許可權

配置使用者許可權我們要用到grant命令,他的格式可以簡單概括為

grant 許可權 on 資料庫物件 to 使用者@使用者登陸位址

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

grant select on testdb.* to common_user@'%'

grant insert on testdb.* to common_user@'%'

grant update on testdb.* to common_user@'%'

grant delete on testdb.* to common_user@'%'

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

grant select, insert, update, delete on testdb.* to common_user@'%'

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

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

grant create on testdb.* to developer@'192.168.0.%';

grant alter on testdb.* to developer@'192.168.0.%';

grant drop on testdb.* to developer@'192.168.0.%';

mysqlgrant 操作 mysql 外來鍵許可權。

grant references on testdb.* to developer@'192.168.0.%';

grant 操作 mysql 臨時表許可權。

grant create temporary tables on testdb.* to

grant 操作 mysql 索引許可權。

grant index on testdb.* to

grant 操作 mysql 檢視、檢視檢視源** 許可權。

grant create view on testdb.* to developer@'192.168.0.%';

grant show view on testdb.* to developer@'192.168.0.%';

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

grant create routine on testdb.* to developer@'192.168.0.%'; -- now, can show procedure status

grant alter routine on testdb.* to developer@'192.168.0.%'; -- now, you can drop a procedure

grant execute on testdb.* to developer@'192.168.0.%';

三、grant 普通 dba 管理某個 mysql 資料庫的許可權。

grant all privileges on testdb to

其中,關鍵字 「privileges」 可以省略。

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

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

grant all on *.* to dba@'localhost'

四、mysql grant 許可權,分別可以作用在多個層次上。

1. grant 作用在整個 mysql 伺服器上: 可以查詢 mysql 中所有資料庫中的表。

grant select on *.* to dba@localhost;

可以管理 mysql 中的所有資料庫

grant all on *.* to dba@localhost;

2. grant 作用在單個資料庫上: 可以查詢 testdb 中的表。

grant select on testdb.* to dba@localhost;

3. grant 作用在單個資料表上:

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

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

grant select(id, se, rank) on testdb.apache_log to

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

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

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

資料 配置管理

目前國內外常見的10種配置管理工具一覽 配置管理不是單純的指軟體的 版本管理,上面的資料介紹的主要是 級管理.配置管理的目的是為了準確交付,減少事故.當專案本身是由多個語言,多個部門來開發,採用了較多開源和第三方的軟體例項時,需要好的配置管理.配置管理之路 scmroad 軟體測試網 軟體測試管理 ...

cmmi配置管理

配置管理的目的是通過執行版本控制 變更控制等規程,以及使用配置管理軟體,來保證所以配置項的完整性和可跟蹤性。配置管理是對工作成果的一種有效保護。凡是納入配置管理範疇的工作成果統稱為配置項 comfiguration item,ci 配置項主要有兩大類 屬於產品組成部分的工作成果,如需求文件 設計文件...

Zookeeper配置管理

zookeeper的的配置可以分為三種,單機,偽集群和集群,三者具體操作差不多 集群時無非就修改一下配置檔案 因為現在手上就一台伺服器,記錄一下單機模式,即一台伺服器既當leader,也當follower。step1 把zookeeper的tar包放在 opt目錄下 解壓。並把資料夾名改為zooke...