When using Mydumper, you need to enter the username and password in the command line, which is recorded in the history, which is relatively insecure.
[Root@liufofu backup]# mydumper-h localhost-u root-p tiger-c-O./liufofu/-B Liufofu
There are 2 types of official solutions available:
1. Create a new one in Homedir. my.cfg, enter your user and password
2, hit the corresponding patch
You can refer to the official reply
1. Use ~/.MY.CFG with your login and password to authenticate. It'll both not save password in bash history and hide password if PS list, but you'll have to keep plaintext Your homedir.
2. Try This patch
Commit 056fa3edc2a3880d35986d6f123430fde5fe292a
Author:dmitry Ilyin <email Address hidden>
Date:sat Oct 27 02:10:40 2012 +0400
Add CmdLine Mask for Mydumper
Diff–git a/mydumper.c b/mydumper.c
Index 9C37D39. 39EDFF1 100644
-a/mydumper.c
+++ B/MYDUMPER.C
@@ -367,6 +367,15 @@ -367,6 Main (int argc, char *argv[])
Init_mutex = G_mutex_new ();
+//calculate Cmdlen
+ int cmdlen = 0;
+ int argn = 0;
+
+ for (argn = 0; argn < argc; ++argn) {
+ Cmdlen + + + (int) strlen (argv[argn]);
+ }
+ Cmdlen = Cmdlen + argc–1;
+
Context = G_option_context_new ("multi-threaded MySQL dumping");
Goptiongroup *main_group= g_option_group_new ("main", "Main Options", "main options", NULL, NULL);
G_option_group_add_entries (main_group, entries);
@@ -377,6 +386,11 @@ -377,6 Main (int argc, char *argv[])
Exit (Exit_failure);
}
G_option_context_free (context);
+
+//erase CmdLine
+ memset (argv[0], ' \0′,cmdlen);
+//set New CmdLine
+ sprintf (argv[0], "mydumper:dumping database '%s '", DB);
if (program_version) {
G_print ("Mydumper%s, built against MySQL%s\n", VERSION, mysql_server_version);
——-
And this is my loader
——-
Commit F8f9850045a317b927903482317ee32ecce47eea
Author:dmitry Ilyin <email Address hidden>
Date:sat Oct 27 02:24:33 2012 +0400
Add CmdLine Mask for Myloader
Diff–git a/myloader.c b/myloader.c
Index 7697E97. A38B4FD 100644
-a/myloader.c
+++ B/MYLOADER.C
@@ -93,6 +93,15 @@ -93,6 Main (int argc, char *argv[]) {
init_mutex= g_mutex_new ();
+//calculate Cmdlen
+ int cmdlen = 0;
+ int argn = 0;
+
+ for (argn = 0; argn < argc; ++argn) {
+ Cmdlen + + + (int) strlen (argv[argn]);
+ }
+ Cmdlen = Cmdlen + argc–1;
+
context= g_option_context_new ("multi-threaded MySQL loader");
Goptiongroup *main_group= g_option_group_new ("main", "Main Options", "main options", NULL, NULL);
G_option_group_add_entries (main_group, entries);
@@ -104,6 +113,11 @@ -104,6 Main (int argc, char *argv[]) {
}
G_option_context_free (context);
+//erase CmdLine
+ memset (argv[0], ' \0′,cmdlen);
+//set New CmdLine
+ sprintf (argv[0], "myloader:loading from directory '%s '", directory);
+
if (program_version) {
G_print ("Myloader%s, built against MySQL%s\n", VERSION, mysql_server_version);
Exit (exit_success);
—-
They Hide Password and other arguments from PS list