mirror of
https://github.com/MariaDB/server.git
synced 2025-05-25 13:42:52 +03:00
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.
This commit is contained in:
parent
fe399f746d
commit
a5a3eb9439
@ -81,13 +81,11 @@ sub usage {
|
|||||||
die @_, $OPTIONS;
|
die @_, $OPTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
# reading ~/.my.cnf
|
# Do not initialize user or password options; that way, any user/password
|
||||||
my @defops = `@bindir@/my_print_defaults client mysqlhotcopy`;
|
# options specified in option files will be used. If no values are specified
|
||||||
chop @defops;
|
# all, the defaults will be used (login name, no password).
|
||||||
splice @ARGV, 0, 0, @defops;
|
|
||||||
|
|
||||||
my %opt = (
|
my %opt = (
|
||||||
user => scalar getpwuid($>),
|
|
||||||
noindices => 0,
|
noindices => 0,
|
||||||
allowold => 0, # for safety
|
allowold => 0, # for safety
|
||||||
keepold => 0,
|
keepold => 0,
|
||||||
@ -170,6 +168,9 @@ $dsn = ";host=" . (defined($opt{host}) ? $opt{host} : "localhost");
|
|||||||
$dsn .= ";port=$opt{port}" if $opt{port};
|
$dsn .= ";port=$opt{port}" if $opt{port};
|
||||||
$dsn .= ";mysql_socket=$opt{socket}" if $opt{socket};
|
$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",
|
my $dbh = DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy",
|
||||||
$opt{user}, $opt{password},
|
$opt{user}, $opt{password},
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user