| 订阅 | 在线投稿
分享
 
 
当前位置: 王朝网络 >> mysql >> MySQL shu ju ku zai wang luo an quan fang mian de yi xie fang yu cuo shi

MySQL shu ju ku zai wang luo an quan fang mian de yi xie fang yu cuo shi

2008-06-12 07:24:52 编辑來源:互联网 评论
 
 
 
本文为【MySQL数据库在网络安全方面的一些防御措施】的拼音翻译版
  sui zhe wang luo de pu ji , ji yu wang luo de ying yong ye yue lai yue duo 。 wang luo shu ju ku jiu shi qi zhong zhi yi 。 tong guo yi tai huo ji tai fu wu qi ke yi wei hen duo ke hu ti gong fu wu , zhe zhong fang shi gei ren men dai lai le hen duo fang bian , dan ye gei bu fa fen zi zao cheng le ke cheng zhi ji 。 you yu shu ju dou shi tong guo wang luo chuan shu de , zhe jiu ke yi zai chuan shu de guo cheng zhong bei jie huo , huo zhe tong guo fei chang shou duan jin ru shu ju ku 。 you yu yi shang yuan yin , shu ju ku an quan jiu xian de shi fen chong yao 。 yin ci , ben wen jiu yi shang wen ti tao lun le MySQL shu ju ku zai wang luo an quan fang mian de yi xie cuo shi 。
  zhang hu an quan
  zhang hu shi MySQL zui jian dan de an quan cuo shi 。 mei yi zhang hu dou you yong hu ming 、 mi ma yi ji wei zhi ( yi ban you fu wu qi ming 、IP huo tong pei fu ) zu cheng 。 ru yong hu john cong server1 jin xing deng lu ke neng he john cong server2 deng lu de quan xian bu tong 。
  MySQL de yong hu jie gou shi yong hu ming / mi ma / wei zhi 。 zhe qi zhong bing bu bao kuo shu ju ku ming 。 xia mian de liang tiao ming ling wei database1 he database2 she zhi le SELECT yong hu quan xian 。
  GRANT SELECT ON database1.* to 'abc'@'server1' IDENTIFIED BY 'password1';
  GRANT SELECT ON database2.* to 'abc'@'server1' IDENTIFIED BY 'password2';
  di yi tiao ming ling she zhi le yong hu abc zai lian jie shu ju ku database1 shi shi yong password1。 di er tiao ming ling she zhi le yong hu abc zai lian jie shu ju ku database2 shi shi yong password2。 yin ci , yong hu abc zai lian jie shu ju ku database1 he database2 de mi ma shi bu yi yang de 。
  shang mian de she zhi shi fei chang you yong de 。 ru guo ni zhi xiang rang yong hu dui yi ge shu ju ku jin xing you xian de fang wen , er dui qi ta shu ju ku bu neng fang wen , zhe yang ke yi dui tong yi ge yong hu she zhi bu tong de mi ma 。 ru guo bu zhe yang zuo , dang yong hu fa xian zhe ge yong hu ming ke yi fang wen qi ta shu ju ku shi , na jiang hui zao cheng ma fan 。
  MySQL shi yong le hen duo shou quan biao lai gen zong yong hu he zhe xie yong hu de bu tong quan xian 。 zhe xie biao jiu shi zai mysql shu ju ku zhong de MyISAM biao 。 jiang zhe xie an quan xin xi bao cun zai MySQL zhong shi fei chang you yi yi de 。 yin ci , wo men ke yi shi yong biao zhun de SQL lai she zhi bu tong de quan xian 。
  yi ban zai MySQL shu ju ku zhong ke yi shi yong 3 zhong bu tong lei xing de an quan jian cha :
  · deng lu yan zheng
  ye jiu shi zui chang yong de yong hu ming he mi ma yan zheng 。 yi dan ni shu ru le zheng que de yong hu ming he mi ma , zhe ge yan zheng jiu ke tong guo 。
  · shou quan
  zai deng lu cheng gong hou , jiu yao qiu dui zhe ge yong hu she zhi ta de ju ti quan xian 。 ru shi fou ke yi shan chu shu ju ku zhong de biao deng 。
  · fang wen kong zhi
  zhe ge an quan lei xing geng ju ti 。 ta she ji dao zhe ge yong hu ke yi dui shu ju biao jin xing shen me yang de cao zuo , ru shi fou ke yi bian ji shu ju ku , shi fou ke yi cha xun shu ju deng deng 。
  fang wen kong zhi you yi xie te quan zu cheng , zhe xie te quan she ji dao suo he shi yong he cao zuo MySQL zhong de shu ju 。 ta men dou shi bu er xing , ji yao me yuan xu , yao me bu yuan xu 。 xia mian shi zhe xie te quan de lie biao :
  ·SELECT
  SELECT shi she ding yong hu shi fou ke yi shi yong SELECT lai cha xun shu ju 。 ru guo yong hu mei you zhe ge te quan , na me jiu zhi neng zhi xing yi xie jian dan de SELECT ming ling , ru ji suan biao da shi (SELECT 1 2), huo shi ri qi zhuan huan (SELECT Unix_TIMESTAMP(NOW( ))) deng 。
  ·INSERT
  ·UPDATE
  ·INDEX
  INDEX jue ding yong hu shi fou ke yi dui biao de suo yin jin xing she zhi 。 ru guo yong hu mei you zhe ge quan xian , na me jiang wu fa she zhi biao zhong de suo yin 。
  ·ALTER
  ·CREATE
  ·GRANT
  ru guo yi ge yong hu yong you zhe ge GRANT quan xian , na me ta jiu ke yi jiang zi ji de quan xian shou gei bie de yong hu 。 ye jiu shi shuo , zhe ge yong hu ke yi he qi ta yong hu gong xiang zi ji de quan xian 。
  ·REFERENCES
  you le REFERENCES quan xian , yong hu jiu ke yi jiang qi ta biao de yi ge zi duan zuo wei mou yi ge biao de wai jian yue shu 。
  chu le yi shang de quan xian wai ,MySQL huan you yi xie quan xian ke yi dui zheng ge MySQL jin xing cao zuo 。
  ·Reload
  zhe ge quan xian ke yi shi yong hu you quan zhi xing ge zhong FLUSH ming ling , ru FLUSH TABLES, FLUSH STATUS deng 。
  ·Shutdown
  zhe ge quan xian yuan xu yong hu guan bi MySQL
  ·Process
  tong guo zhe ge quan xian , yong hu ke yi zhi xing SHOW PROCESSLIST he KILL ming ling 。 zhe xie ming ling ke yi cha kan MySQL de chu li jin cheng , ke yi tong guo zhe zhong fang shi cha kan SQL zhi xing de xi jie 。
  ·File
  zhe ge quan xian jue ding yong hu shi fou ke yi zhi xing LOAD DATA INFILE ming ling 。 gei yong hu zhe ge quan xian yao shen chong , yin wei you zhe ge quan xian de yong hu ke yi jiang ren yi de wen jian zhuang zai dao biao zhong , zhe yang dui MySQL shi shi fen wei xian de 。
  ·Super
  zhe ge quan xian yuan xu yong hu zhong zhi ren he cha xun ( zhe xie cha xun ke neng bing bu shi zhe ge yong hu zhi xing de )。
  yi shang ji zhong quan xian shi fei chang wei xian de , zai gei yong hu shou quan xian shi yao fei chang jin shen 。
  
  MySQL zhong de SSL
  yi shang de zhang hu an quan zhi shi yi pu tong de Socket jin xing shu ju chuan shu de , zhe yang fei chang bu an quan 。 yin ci ,MySQL zai 4.1 ban yi hou ti gong le dui SSL(Secure Scokets Layer) de zhi chi 。MySQL shi yong de shi mian fei de OpenSSL ku 。
  you yu MySQL de Linux ban ben yi ban dou shi sui Linux ben shen yi qi fa bu , yin ci , ta men mo ren shi dou bu shi yong SSL jin xing chuan shu shu ju 。 ru guo yao da kai SSL gong neng , xu yao dui hava_openssl bian liang jin xing she zhi :
  MySQL de Windows ban ben yi jing jiang OpenSSL jia ru le 。 ye mian de ming ling shi cha kan ni de MySQL shi fou da kai le SSL gong neng 。
  SHOW VARIABLES LIKE 'have_openssl';
  --------------- -------
  | Variable_name | Value |
  --------------- -------
  | have_openssl | NO |
  --------------- -------
  1 row in set (0.00 sec)
  ru guo fan hui de shi NO, na me shuo ming ni xu yao jiang OpenSSL bian yi jin zi ji de MySQL zai you shi ni ke neng xu yao jiang yong hu ming he mi ma jin xing jia mi chuan shu 。 zai zhe shi ke yi shi yong xia mian GRANT ming ling :
  GRANT ALL PRIVILEGES ON ssl_only_db.
  * to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE SSL;
  huan ke yi tong guo REQUIRE x509 xuan xiang jin xing SSL chuan shu :
  GRANT ALL PRIVILEGES ON ssl_only_db.
  * to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE x509;
  ni huan ke yi shi yong REQUIRE SUBJECT lai zhi ding yi ge te ding de ke hu duan zheng shu lai fang wen shu ju ku 。
  GRANT ALL PRIVILEGES ON ssl_only_db.* to 'abc'@'%'
  IDENTIFIED BY "password!"
  REQUIRE SUBJECT "/C=US/ST=New York/L=Albany/O=Widgets Inc./CN=client-ray.
  example.com/emailAddress=raymond@example.com";
  ye xu ni bing bu guan xin shi yong de shi shen me ke hu xu ke , er jin jin guan xin de shi ni de zheng shu 。 na me ni ke yi shi yong REQUIRE ISSUER lai shi xian :
  GRANT ALL PRIVILEGES ON ssl_only_db.
  * to 'abc'@'%' IDENTIFIED BY "password!"
  REQUIRE ISSUER
  "/C=US/ST=New 20York/L=Albany/O=Widgets Inc./CN=cacert.example.
  com/emailAddress=admin@example.com";
  SSL huan ke yi zhi jie tong guo mi ma jin xing jia mi 。 ke yi shi yong REQUIRE CIPHER she zhi mi ma 。
  GRANT ALL PRIVILEGES ON ssl_only_db.
  * to 'abc'@'%' IDENTIFIED BY "password!"
  REQUIRE CIPHER "EDH-RSA-DES-CBC3-SHA";
  shang mian shi yong le GRANT ming ling dui yong hu quan xian jin xing she zhi 。 er zhe xie xin xi dou shi bao cun zai shou quan biao zhong , zhe xie biao shi an quan xi tong de xin zang 。 zai zhe xie biao zhong bao cun le mei yi ge yong hu he ke hu ji suo ju you de quan xian 。 ru guo zheng que di cao zuo zhe xie biao , jiang hui dui shu ju ku de an quan qi dao ji ji de zuo yong , er ru guo shi yong bu shen , jiang shi fei chang wei xian de 。
  xia mian rang wo men lai kan kan MySQL zhong de zui yao de 5 ge shou quan biao 。
  user
  yong hu biao bao cun le yong hu de quan xian he bei jia mi de mi ma 。 zhe ge biao fu ze que ding na xie yong hu he ke hu ji ke yi lian jie dao fu wu qi shang 。
  host
  zhe ge biao wei mei yi ge ke hu ji fen pei quan xian , ta bing bu kao lv yong hu de quan xian 。MySQL zai que ding shi fou jie shou huan shi ju jue yi ge lian jie shi , shou xian kao lv de shi user biao 。 er shi yong GRANT huo REVOKE ming ling bing bu ying xiang host biao , wo men ke yi tong guo shou gong fang shi xiu gai zhe ge biao zhong de nei rong 。
  db
  db biao bao cun le shu ju ku ceng de quan xian xin xi 。
  tables_priv
  zhe ge biao cun chu le biao de quan xian xin xi 。
  columns_priv
  zhe ge biao bao cun le dan du lie de quan xian xin xi 。 tong guo zhe ge biao , ke yi jiang cao zuo mou yi lie de quan xian shou yu yi ge yong hu 。
  
  ha xi jia mi
  ru guo shu ju ku bao cun le min gan de shu ju , ru yin xing ka mi ma , ke hu xin xi deng , ni ke neng xiang jiang zhe xie shu ju yi jia mi de xing shi bao cun zai shu ju ku zhong 。 zhe yang ji shi you ren jin ru le ni de shu ju ku , bing kan dao le zhe xie shu ju , ye hen nan huo de qi zhong de zhen shi xin xi 。
  zai ying yong cheng xu de da liang xin xi zhong , ye xu ni zhi xiang jiao hen xiao de yi bu fen jin xing jia mi , ru yong hu de mi ma deng 。 zhe xie mi ma bu ying gai yi ming wen de xing shi bao cun , ta men ying gai yi jia mi de xing shi bao cun zai shu ju ku zhong 。 yi ban qing kuang xia , da duo shu xi tong , zhe qi zhong bao kuo MySQL ben shen dou shi shi yong ha xi suan fa dui min gan shu ju jin xing jia mi de 。
  ha xi jia mi shi dan xiang jia mi , ye jiu shi shuo , bei jia mi de zi fu chuan shi wu fa de dao yuan zi fu chuan de 。 zhe zhong fang fa shi yong hen you xian , yi ban zhi shi yong zai mi ma yan zheng huo qi ta xu yao yan zheng de di fang 。 zai bi jiao shi bing bu shi jiang jia mi zi fu chuan jin xing jie mi , er shi jiang shu ru de zi fu chuan ye shi yong tong yang de fang fa jin xing jia mi , zai he shu ju ku zhong de jia mi zi fu chuan jin xing bi jiao 。 zhe yang ji shi zhi dao le suan fa bing de dao le jia mi zi fu chuan , ye wu fa huan yuan zui chu de zi fu chuan 。 yin xing ka mi ma jiu shi cai yong de zhe zhong fang shi jin xing jia mi 。
  MySQL ti gong le 4 ge han shu yong yu ha xi jia mi :PASSWORD, ENCRYPT, SHA1 he MD5。 xia mian rang wo men shi yi shi zhe 4 ge han shu , kan kan hui de dao shen me jie guo 。 wo men yi jia mi zi fu chuan "pa55word" wei li jin xing shuo ming :
  rang wo men xian lai kan kan MD5 han shu :
  SELECT MD5('pa55word');
  ----------------------------------
  | MD5('pa55word') |
  ----------------------------------
  | a17a41337551d6542fd005e18b43afd4 |
  ----------------------------------
  1 row in set (0.13 sec)
  xia mian shi PASSWORD han shu :
  SELECT PASSWORD('pa55word');
  ----------------------
  | PASSWORD('pa55word') |
  ----------------------
  | 1d35c6556b8cab45 |
  ----------------------
  1 row in set (0.00 sec)
  xia mian shi ENCRYPT han shu :
  SELECT ENCRYPT('pa55word');
  ---------------------
  | ENCRYPT('pa55word') |
  ---------------------
  | up2Ecb0Hdj25A |
  ---------------------
  1 row in set (0.17 sec)
  shang mian de mei ge han shu dou fan hui le yi ge jia mi hou de zi fu chuan 。 wei le qu fen jia mi zi fu chuan de da xiao xie , zui hao zai shi yong ENCRYPT sheng cheng jia mi zi fu chuan shi , jiang zhe ge zi duan ding yi cheng CHAR BINARY lei xing 。
  shang mian lie ju le 3 zhong jia mi de fang fa , dan wo ren wei shi yong MD5 jia mi shi zui hao de 。 zhe shi yin wei zhe yang zuo ke yi jiang ming wen mi ma xian shi zai chu li lie biao zhong huo shi cha xun ri zhi zhong , zhe yang bian yu gen zong 。 ru xia mian de INSERT yu ju shi yong cha ru le yi tiao ji lu , qi zhong de mi ma shi yong le MD5 jin xing jia mi :
  INSERT INTO table1 (user, pw) VALUE ('user1', MD5('password1') )
  ke yi tong guo ru xia de yu ju jin xing mi ma yan zheng :
  SELECT * FROM table1 WHERE user = 'user1' AND pw = MD5('password1')
  ha xi jia mi fang fa ke yi hen hao di dui mi ma jin xing jia mi , shi yong le zhe zhong fang fa jia mi , mi ma jiang wu fa hui fu cheng ming wen 。【原文】【汉音对照
 
 
 
 
 
 
 
 
 
日版宠物情人插曲《Winding Road》歌词

日版宠物情人2017的插曲,很带节奏感,日语的,女生唱的。 最后听见是在第8集的时候女主手割伤了,然后男主用嘴帮她吸了一下,插曲就出来了。 歌手:Def...

兄弟共妻,我成了他们夜里的美食

老钟家的两个儿子很特别,就是跟其他的人不太一样,魔一般的执着。兄弟俩都到了要结婚的年龄了,不管自家老爹怎么磨破嘴皮子,兄弟俩说不娶就不娶,老父母为兄弟两操碎了心...

如何磨出破洞牛仔裤?牛仔裤怎么剪破洞?

把牛仔裤磨出有线的破洞 1、具体工具就是磨脚石,下面垫一个硬物,然后用磨脚石一直磨一直磨,到把那块磨薄了,用手撕开就好了。出来的洞啊很自然的。需要猫须的话调几...

我就是扫描下图得到了敬业福和爱国福

先来看下敬业福和爱国福 今年春节,支付宝再次推出了“五福红包”活动,表示要“把欠大家的敬业福都还给大家”。 今天该活动正式启动,和去年一样,需要收集“五福”...

冰箱异味产生的原因和臭味去除的方法

有时候我们打开冰箱就会闻到一股异味,冰箱里的这种异味是因为一些物质发出的气味的混合体,闻起来让人恶心。 产生这些异味的主要原因有以下几点。 1、很多人有这种习...

 
 
sui zhe wang luo de pu ji , ji yu wang luo de ying yong ye yue lai yue duo 。 wang luo shu ju ku jiu shi qi zhong zhi yi 。 tong guo yi tai huo ji tai fu wu qi ke yi wei hen duo ke hu ti gong fu wu , zhe zhong fang shi gei ren men dai lai le hen duo fang bian , dan ye gei bu fa fen zi zao cheng le ke cheng zhi ji 。 you yu shu ju dou shi tong guo wang luo chuan shu de , zhe jiu ke yi zai chuan shu de guo cheng zhong bei jie huo , huo zhe tong guo fei chang shou duan jin ru shu ju ku 。 you yu yi shang yuan yin , shu ju ku an quan jiu xian de shi fen chong yao 。 yin ci , ben wen jiu yi shang wen ti tao lun le MySQL shu ju ku zai wang luo an quan fang mian de yi xie cuo shi 。 zhang hu an quan zhang hu shi MySQL zui jian dan de an quan cuo shi 。 mei yi zhang hu dou you yong hu ming 、 mi ma yi ji wei zhi ( yi ban you fu wu qi ming 、IP huo tong pei fu ) zu cheng 。 ru yong hu john cong server1 jin xing deng lu ke neng he john cong server2 deng lu de quan xian bu tong 。 MySQL de yong hu jie gou shi yong hu ming / mi ma / wei zhi 。 zhe qi zhong bing bu bao kuo shu ju ku ming 。 xia mian de liang tiao ming ling wei database1 he database2 she zhi le SELECT yong hu quan xian 。 GRANT SELECT ON database1.* to 'abc'@'server1' IDENTIFIED BY 'password1'; GRANT SELECT ON database2.* to 'abc'@'server1' IDENTIFIED BY 'password2'; di yi tiao ming ling she zhi le yong hu abc zai lian jie shu ju ku database1 shi shi yong password1。 di er tiao ming ling she zhi le yong hu abc zai lian jie shu ju ku database2 shi shi yong password2。 yin ci , yong hu abc zai lian jie shu ju ku database1 he database2 de mi ma shi bu yi yang de 。 shang mian de she zhi shi fei chang you yong de 。 ru guo ni zhi xiang rang yong hu dui yi ge shu ju ku jin xing you xian de fang wen , er dui qi ta shu ju ku bu neng fang wen , zhe yang ke yi dui tong yi ge yong hu she zhi bu tong de mi ma 。 ru guo bu zhe yang zuo , dang yong hu fa xian zhe ge yong hu ming ke yi fang wen qi ta shu ju ku shi , na jiang hui zao cheng ma fan 。 MySQL shi yong le hen duo shou quan biao lai gen zong yong hu he zhe xie yong hu de bu tong quan xian 。 zhe xie biao jiu shi zai mysql shu ju ku zhong de MyISAM biao 。 jiang zhe xie an quan xin xi bao cun zai MySQL zhong shi fei chang you yi yi de 。 yin ci , wo men ke yi shi yong biao zhun de SQL lai she zhi bu tong de quan xian 。 yi ban zai MySQL shu ju ku zhong ke yi shi yong 3 zhong bu tong lei xing de an quan jian cha : · deng lu yan zheng ye jiu shi zui chang yong de yong hu ming he mi ma yan zheng 。 yi dan ni shu ru le zheng que de yong hu ming he mi ma , zhe ge yan zheng jiu ke tong guo 。 · shou quan zai deng lu cheng gong hou , jiu yao qiu dui zhe ge yong hu she zhi ta de ju ti quan xian 。 ru shi fou ke yi shan chu shu ju ku zhong de biao deng 。 · fang wen kong zhi zhe ge an quan lei xing geng ju ti 。 ta she ji dao zhe ge yong hu ke yi dui shu ju biao jin xing shen me yang de cao zuo , ru shi fou ke yi bian ji shu ju ku , shi fou ke yi cha xun shu ju deng deng 。 fang wen kong zhi you yi xie te quan zu cheng , zhe xie te quan she ji dao suo he shi yong he cao zuo MySQL zhong de shu ju 。 ta men dou shi bu er xing , ji yao me yuan xu , yao me bu yuan xu 。 xia mian shi zhe xie te quan de lie biao : ·SELECT SELECT shi she ding yong hu shi fou ke yi shi yong SELECT lai cha xun shu ju 。 ru guo yong hu mei you zhe ge te quan , na me jiu zhi neng zhi xing yi xie jian dan de SELECT ming ling , ru ji suan biao da shi (SELECT 1 2), huo shi ri qi zhuan huan (SELECT Unix_TIMESTAMP(NOW( ))) deng 。 ·INSERT ·UPDATE ·INDEX INDEX jue ding yong hu shi fou ke yi dui biao de suo yin jin xing she zhi 。 ru guo yong hu mei you zhe ge quan xian , na me jiang wu fa she zhi biao zhong de suo yin 。 ·ALTER ·CREATE ·GRANT ru guo yi ge yong hu yong you zhe ge GRANT quan xian , na me ta jiu ke yi jiang zi ji de quan xian shou gei bie de yong hu 。 ye jiu shi shuo , zhe ge yong hu ke yi he qi ta yong hu gong xiang zi ji de quan xian 。 ·REFERENCES you le REFERENCES quan xian , yong hu jiu ke yi jiang qi ta biao de yi ge zi duan zuo wei mou yi ge biao de wai jian yue shu 。 chu le yi shang de quan xian wai ,MySQL huan you yi xie quan xian ke yi dui zheng ge MySQL jin xing cao zuo 。 ·Reload zhe ge quan xian ke yi shi yong hu you quan zhi xing ge zhong FLUSH ming ling , ru FLUSH TABLES, FLUSH STATUS deng 。 ·Shutdown zhe ge quan xian yuan xu yong hu guan bi MySQL ·Process tong guo zhe ge quan xian , yong hu ke yi zhi xing SHOW PROCESSLIST he KILL ming ling 。 zhe xie ming ling ke yi cha kan MySQL de chu li jin cheng , ke yi tong guo zhe zhong fang shi cha kan SQL zhi xing de xi jie 。 ·File zhe ge quan xian jue ding yong hu shi fou ke yi zhi xing LOAD DATA INFILE ming ling 。 gei yong hu zhe ge quan xian yao shen chong , yin wei you zhe ge quan xian de yong hu ke yi jiang ren yi de wen jian zhuang zai dao biao zhong , zhe yang dui MySQL shi shi fen wei xian de 。 ·Super zhe ge quan xian yuan xu yong hu zhong zhi ren he cha xun ( zhe xie cha xun ke neng bing bu shi zhe ge yong hu zhi xing de )。 yi shang ji zhong quan xian shi fei chang wei xian de , zai gei yong hu shou quan xian shi yao fei chang jin shen 。 MySQL zhong de SSL yi shang de zhang hu an quan zhi shi yi pu tong de Socket jin xing shu ju chuan shu de , zhe yang fei chang bu an quan 。 yin ci ,MySQL zai 4.1 ban yi hou ti gong le dui SSL(Secure Scokets Layer) de zhi chi 。MySQL shi yong de shi mian fei de OpenSSL ku 。    you yu MySQL de Linux ban ben yi ban dou shi sui Linux ben shen yi qi fa bu , yin ci , ta men mo ren shi dou bu shi yong SSL jin xing chuan shu shu ju 。 ru guo yao da kai SSL gong neng , xu yao dui hava_openssl bian liang jin xing she zhi : MySQL de Windows ban ben yi jing jiang OpenSSL jia ru le 。 ye mian de ming ling shi cha kan ni de MySQL shi fou da kai le SSL gong neng 。 SHOW VARIABLES LIKE 'have_openssl'; --------------- ------- | Variable_name | Value | --------------- ------- | have_openssl | NO | --------------- ------- 1 row in set (0.00 sec) ru guo fan hui de shi NO, na me shuo ming ni xu yao jiang OpenSSL bian yi jin zi ji de MySQL zai you shi ni ke neng xu yao jiang yong hu ming he mi ma jin xing jia mi chuan shu 。 zai zhe shi ke yi shi yong xia mian GRANT ming ling : GRANT ALL PRIVILEGES ON ssl_only_db. * to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE SSL; huan ke yi tong guo REQUIRE x509 xuan xiang jin xing SSL chuan shu : GRANT ALL PRIVILEGES ON ssl_only_db. * to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE x509; ni huan ke yi shi yong REQUIRE SUBJECT lai zhi ding yi ge te ding de ke hu duan zheng shu lai fang wen shu ju ku 。 GRANT ALL PRIVILEGES ON ssl_only_db.* to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE SUBJECT "/C=US/ST=New York/L=Albany/O=Widgets Inc./CN=client-ray. example.com/emailAddress=raymond@example.com"; ye xu ni bing bu guan xin shi yong de shi shen me ke hu xu ke , er jin jin guan xin de shi ni de zheng shu 。 na me ni ke yi shi yong REQUIRE ISSUER lai shi xian : GRANT ALL PRIVILEGES ON ssl_only_db. * to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE ISSUER "/C=US/ST=New 20York/L=Albany/O=Widgets Inc./CN=cacert.example. com/emailAddress=admin@example.com"; SSL huan ke yi zhi jie tong guo mi ma jin xing jia mi 。 ke yi shi yong REQUIRE CIPHER she zhi mi ma 。 GRANT ALL PRIVILEGES ON ssl_only_db. * to 'abc'@'%' IDENTIFIED BY "password!" REQUIRE CIPHER "EDH-RSA-DES-CBC3-SHA"; shang mian shi yong le GRANT ming ling dui yong hu quan xian jin xing she zhi 。 er zhe xie xin xi dou shi bao cun zai shou quan biao zhong , zhe xie biao shi an quan xi tong de xin zang 。 zai zhe xie biao zhong bao cun le mei yi ge yong hu he ke hu ji suo ju you de quan xian 。 ru guo zheng que di cao zuo zhe xie biao , jiang hui dui shu ju ku de an quan qi dao ji ji de zuo yong , er ru guo shi yong bu shen , jiang shi fei chang wei xian de 。 xia mian rang wo men lai kan kan MySQL zhong de zui yao de 5 ge shou quan biao 。 user yong hu biao bao cun le yong hu de quan xian he bei jia mi de mi ma 。 zhe ge biao fu ze que ding na xie yong hu he ke hu ji ke yi lian jie dao fu wu qi shang 。 host zhe ge biao wei mei yi ge ke hu ji fen pei quan xian , ta bing bu kao lv yong hu de quan xian 。MySQL zai que ding shi fou jie shou huan shi ju jue yi ge lian jie shi , shou xian kao lv de shi user biao 。 er shi yong GRANT huo REVOKE ming ling bing bu ying xiang host biao , wo men ke yi tong guo shou gong fang shi xiu gai zhe ge biao zhong de nei rong 。 db db biao bao cun le shu ju ku ceng de quan xian xin xi 。 tables_priv zhe ge biao cun chu le biao de quan xian xin xi 。 columns_priv zhe ge biao bao cun le dan du lie de quan xian xin xi 。 tong guo zhe ge biao , ke yi jiang cao zuo mou yi lie de quan xian shou yu yi ge yong hu 。 ha xi jia mi ru guo shu ju ku bao cun le min gan de shu ju , ru yin xing ka mi ma , ke hu xin xi deng , ni ke neng xiang jiang zhe xie shu ju yi jia mi de xing shi bao cun zai shu ju ku zhong 。 zhe yang ji shi you ren jin ru le ni de shu ju ku , bing kan dao le zhe xie shu ju , ye hen nan huo de qi zhong de zhen shi xin xi 。 zai ying yong cheng xu de da liang xin xi zhong , ye xu ni zhi xiang jiao hen xiao de yi bu fen jin xing jia mi , ru yong hu de mi ma deng 。 zhe xie mi ma bu ying gai yi ming wen de xing shi bao cun , ta men ying gai yi jia mi de xing shi bao cun zai shu ju ku zhong 。 yi ban qing kuang xia , da duo shu xi tong , zhe qi zhong bao kuo MySQL ben shen dou shi shi yong ha xi suan fa dui min gan shu ju jin xing jia mi de 。 ha xi jia mi shi dan xiang jia mi , ye jiu shi shuo , bei jia mi de zi fu chuan shi wu fa de dao yuan zi fu chuan de 。 zhe zhong fang fa shi yong hen you xian , yi ban zhi shi yong zai mi ma yan zheng huo qi ta xu yao yan zheng de di fang 。 zai bi jiao shi bing bu shi jiang jia mi zi fu chuan jin xing jie mi , er shi jiang shu ru de zi fu chuan ye shi yong tong yang de fang fa jin xing jia mi , zai he shu ju ku zhong de jia mi zi fu chuan jin xing bi jiao 。 zhe yang ji shi zhi dao le suan fa bing de dao le jia mi zi fu chuan , ye wu fa huan yuan zui chu de zi fu chuan 。 yin xing ka mi ma jiu shi cai yong de zhe zhong fang shi jin xing jia mi 。 MySQL ti gong le 4 ge han shu yong yu ha xi jia mi :PASSWORD, ENCRYPT, SHA1 he MD5。 xia mian rang wo men shi yi shi zhe 4 ge han shu , kan kan hui de dao shen me jie guo 。 wo men yi jia mi zi fu chuan "pa55word" wei li jin xing shuo ming : rang wo men xian lai kan kan MD5 han shu : SELECT MD5('pa55word'); ---------------------------------- | MD5('pa55word') | ---------------------------------- | a17a41337551d6542fd005e18b43afd4 | ---------------------------------- 1 row in set (0.13 sec) xia mian shi PASSWORD han shu : SELECT PASSWORD('pa55word'); ---------------------- | PASSWORD('pa55word') | ---------------------- | 1d35c6556b8cab45 | ---------------------- 1 row in set (0.00 sec) xia mian shi ENCRYPT han shu : SELECT ENCRYPT('pa55word'); --------------------- | ENCRYPT('pa55word') | --------------------- | up2Ecb0Hdj25A | --------------------- 1 row in set (0.17 sec) shang mian de mei ge han shu dou fan hui le yi ge jia mi hou de zi fu chuan 。 wei le qu fen jia mi zi fu chuan de da xiao xie , zui hao zai shi yong ENCRYPT sheng cheng jia mi zi fu chuan shi , jiang zhe ge zi duan ding yi cheng CHAR BINARY lei xing 。 shang mian lie ju le 3 zhong jia mi de fang fa , dan wo ren wei shi yong MD5 jia mi shi zui hao de 。 zhe shi yin wei zhe yang zuo ke yi jiang ming wen mi ma xian shi zai chu li lie biao zhong huo shi cha xun ri zhi zhong , zhe yang bian yu gen zong 。 ru xia mian de INSERT yu ju shi yong cha ru le yi tiao ji lu , qi zhong de mi ma shi yong le MD5 jin xing jia mi : INSERT INTO table1 (user, pw) VALUE ('user1', MD5('password1') ) ke yi tong guo ru xia de yu ju jin xing mi ma yan zheng : SELECT * FROM table1 WHERE user = 'user1' AND pw = MD5('password1') ha xi jia mi fang fa ke yi hen hao di dui mi ma jin xing jia mi , shi yong le zhe zhong fang fa jia mi , mi ma jiang wu fa hui fu cheng ming wen 。
󰈣󰈤
  免责声明:本文仅代表作者个人观点,与王朝网络无关。王朝网络登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
华丽的模特拍摄(8)
华丽的模特拍摄(7)
华丽的模特拍摄(6)
华丽的模特拍摄(5)
八里沟
朝阳宫
天下峨眉 云上金顶
老家(四)
 
>>返回首页<<
 
 
 为你推荐
 
 
 
 转载本文
 UBB代码 HTML代码
复制到剪贴板...
 
 热帖排行
 
 
 
 
 
©2005- 王朝网络 版权所有