summaryrefslogtreecommitdiff
path: root/scripts/mysqlhotcopy.sh
diff options
context:
space:
mode:
authorpaul@teton.kitebird.com <>2003-07-08 11:25:46 -0500
committerpaul@teton.kitebird.com <>2003-07-08 11:25:46 -0500
commita5a3eb94393e11aef81d9bec76b3d10ba8fa343c (patch)
tree907cfe31431c14cc2522b80f7f738a567d9b421b /scripts/mysqlhotcopy.sh
parentfe399f746d3f4b2f0c6b8c3e44d5955313ca6060 (diff)
downloadmariadb-git-a5a3eb94393e11aef81d9bec76b3d10ba8fa343c.tar.gz
mysqlhotcopy.sh:
Undo serg's patch that used my_print_defaults, and instead simply do not define $opt{user}. This allows the script to use option files properly.
Diffstat (limited to 'scripts/mysqlhotcopy.sh')
-rw-r--r--scripts/mysqlhotcopy.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 7385be65092..fc89a967e16 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -81,13 +81,11 @@ sub usage {
die @_, $OPTIONS;
}
-# reading ~/.my.cnf
-my @defops = `@bindir@/my_print_defaults client mysqlhotcopy`;
-chop @defops;
-splice @ARGV, 0, 0, @defops;
+# Do not initialize user or password options; that way, any user/password
+# options specified in option files will be used. If no values are specified
+# all, the defaults will be used (login name, no password).
my %opt = (
- user => scalar getpwuid($>),
noindices => 0,
allowold => 0, # for safety
keepold => 0,
@@ -170,6 +168,9 @@ $dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost");
$dsn .= ";port=$opt{port}" if $opt{port};
$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket};
+# use mysql_read_default_group=mysqlhotcopy so that [client] and
+# [mysqlhotcopy] groups will be read from standard options files.
+
my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy",
$opt{user}, $opt{password},
{