這篇文章主要為大家展示了“MySQL中如何使用正則不允許對(duì)整表進(jìn)行操作”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“mysql中如何使用正則不允許對(duì)整表進(jìn)行操作”這篇文章吧。
成都創(chuàng)新互聯(lián)主要從事網(wǎng)站建設(shè)、網(wǎng)站制作、網(wǎng)頁(yè)設(shè)計(jì)、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)眉縣,十多年網(wǎng)站建設(shè)經(jīng)驗(yàn),價(jià)格優(yōu)惠、服務(wù)專業(yè),歡迎來(lái)電咨詢建站服務(wù):13518219792
-- 禁止應(yīng)用查看表結(jié)構(gòu)
delete from mysql_query_rules where rule_id=10006;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10006,1,'yrzif_test2','yrzif_test2','^desc\s*\S*','desc is not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止應(yīng)用對(duì)information_schema進(jìn)行查詢
delete from mysql_query_rules where rule_id=10007;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10007,1,'yrzif_test2','yrzif_test2','\s*\S*information_schema\s*\S*','query on information_schema is not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對(duì)整表進(jìn)行不加條件的查詢
delete from mysql_query_rules where rule_id=10001;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_pattern, error_msg,destination_hostgroup, apply)
VALUES (10001,1,'yrzif_test2','yrzif_test2','^SELECT\s*\*\s*from\s*fi_user_bak$','Query not allowed',2,1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對(duì)整表進(jìn)行不加條件的刪除
delete from mysql_query_rules where rule_id=1002;
INSERT INTO mysql_query_rules (rule_id, active, username,schemaname,match_pattern, error_msg, apply) VALUES (1002,1,'yrzif_test2','yrzif_test2','^DELETE\s*from\s*fi_user_bak$','Query not allowed',1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
-- 禁止對(duì)整表進(jìn)行不加條件的更新
delete from mysql_query_rules where rule_id=1003;
delete from mysql_query_rules where rule_id=1004;
delete from mysql_query_rules where rule_id=1005;
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, match_digest, flagOUT, apply) VALUES (1003,1,'yrzif_test2','yrzif_test2','^update\s*fi_user_bak', 100, 0);
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, flagIN, match_digest, destination_hostgroup, apply) VALUES (1004,1,'yrzif_test2','yrzif_test2', 100, 'WHERE', 9, 1);
INSERT INTO mysql_query_rules (rule_id, active,username,schemaname, flagIN, error_msg, apply) VALUES (1005,1, 'yrzif_test2','yrzif_test2',100, 'Query not allowed', 1);
LOAD MYSQL QUERY RULES TO RUNTIME;SAVE MYSQL QUERY RULES TO DISK;
以上是“mysql中如何使用正則不允許對(duì)整表進(jìn)行操作”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!
網(wǎng)頁(yè)名稱:mysql中如何使用正則不允許對(duì)整表進(jìn)行操作
文章網(wǎng)址:http://jinyejixie.com/article48/ppejep.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、電子商務(wù)、App開發(fā)、定制網(wǎng)站、網(wǎng)站設(shè)計(jì)、網(wǎng)站收錄
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)