linux中mydumper需要输入明文密码解决方案

小浪SEO博客 专注SEO优化思维、SEO技术的实战分享类博客~

下面来给各位介绍一下关于linux中mydumper需要输入明文密码解决方案,希望能帮助到各位同学.

在使用mydumper时,需要再命令行中输入用户名和密码,这会记录到history中,这样的话,就是相对不安全.

[root@liufofu backup]# mydumper -h localhost -u root -p tiger -c -o ./liufofu/ -B liufofu

查了下官方提供的解决方案有2种:

1、在homedir中新建一个.my.cfg,输入你的用户和密码

2、打上相应的补丁

具体可以参考官方的回复:

  1. 1.Use~/.my.cfgwithyourloginandpasswordtoauthenticate.Itwillbothnotsavepasswordinbashhistoryandhidepasswordifpslist,butyou’llhavetokeepplaintextpasswordinyourhomedir.
  2. 2.Trythispatch
  3. commit056fa3edc2a3880d35986d6f123430fde5fe292a
  4. Author:DmitryIlyin<emailaddresshidden>
  5. Date:SatOct2702:10:402012+0400
  6. Addcmdlinemaskformydumper
  7. diff–gita/mydumper.cb/mydumper.c
  8. index9c37d39..39edff1100644
  9. —a/mydumper.c
  10. +++b/mydumper.c
  11. @@-367,6+367,15@@intmain(intargc,char*argv[])
  12. init_mutex=g_mutex_new();
  13. +//calculatecmdlen
  14. +intcmdlen=0;
  15. +intargn=0;
  16. +
  17. +for(argn=0;argn<argc;++argn){
  18. +cmdlen+=(int)strlen(argv[argn]);
  19. +}
  20. +cmdlen=cmdlen+argc–1;
  21. +
  22. context=g_option_context_new(“multi-threadedMySQLdumping”);
  23. GOptionGroup*main_group=g_option_group_new(“main”,“MainOptions”,“MainOptions”,NULL,NULL);
  24. g_option_group_add_entries(main_group,entries);
  25. @@-377,6+386,11@@intmain(intargc,char*argv[])
  26. exit(EXIT_FAILURE);
  27. }
  28. g_option_context_free(context);
  29. +
  30. +//erasecmdline
  31. +memset(argv[0],’\0′,cmdlen);
  32. +//setnewcmdline
  33. +sprintf(argv[0],”mydumper:dumpingdatabase‘%s’”,db);
  34. if(program_version){
  35. g_print(“mydumper%s,builtagainstMySQL%s\n”,VERSION,MYSQL_SERVER_VERSION);
  36. ——-
  37. andthisformyloader
  38. ——-
  39. commitf8f9850045a317b927903482317ee32ecce47eea
  40. Author:DmitryIlyin<emailaddresshidden>
  41. Date:SatOct2702:24:332012+0400
  42. Addcmdlinemaskformyloader
  43. diff–gita/myloader.cb/myloader.c
  44. index7697e97..a38b4fd100644
  45. —a/myloader.c
  46. +++b/myloader.c
  47. @@-93,6+93,15@@intmain(intargc,char*argv[]){
  48. init_mutex=g_mutex_new();
  49. +//calculatecmdlen
  50. +intcmdlen=0;
  51. +intargn=0;
  52. +
  53. +for(argn=0;argn<argc;++argn){
  54. +cmdlen+=(int)strlen(argv[argn]);
  55. +}
  56. +cmdlen=cmdlen+argc–1;
  57. +
  58. context=g_option_context_new(“multi-threadedMySQLloader”);
  59. GOptionGroup*main_group=g_option_group_new(“main”,“MainOptions”,“MainOptions”,NULL,NULL);
  60. g_option_group_add_entries(main_group,entries);
  61. @@-104,6+113,11@@intmain(intargc,char*argv[]){
  62. }
  63. g_option_context_free(context);
  64. +//erasecmdline
  65. +memset(argv[0],’\0′,cmdlen);
  66. +//setnewcmdline
  67. +sprintf(argv[0],”myloader:loadingfromdirectory‘%s’”,directory);
  68. +--phpfensi.com
  69. if(program_version){
  70. g_print(“myloader%s,builtagainstMySQL%s\n”,VERSION,MYSQL_SERVER_VERSION);
  71. exit(EXIT_SUCCESS);
  72. —-
  73. Theyhidepasswordandotherargumentsfrompslist

相关广告
  • linux中mydumper需要输入明文密码解决方案 linux中mydumper需要输入明文密码解决方案 linux中mydumper需要输入明文密码解决方案
相关阅读

linux中mydumper需要输入明文密码解决方案

2019/10/10 17:47:12 | 谷歌SEO算法 | 区块链