|
|
|
@ -103,7 +103,7 @@ sub main |
|
|
|
print "WARNING: my_print_defaults command not found.\n"; |
|
|
|
print "Please make sure you have this command available and\n"; |
|
|
|
print "in your path. The command is available from the latest\n"; |
|
|
|
print "MySQL distribution.\n"; |
|
|
|
print "MariaDB distribution.\n"; |
|
|
|
$my_print_defaults_exists= 0; |
|
|
|
} |
|
|
|
|
|
|
|
@ -153,7 +153,7 @@ sub main |
|
|
|
if (!defined(my_which(my_print_defaults))) |
|
|
|
{ |
|
|
|
print "ABORT: Can't find command 'my_print_defaults'.\n"; |
|
|
|
print "This command is available from the latest MySQL\n"; |
|
|
|
print "This command is available from the latest MariaDB\n"; |
|
|
|
print "distribution. Please make sure you have the command\n"; |
|
|
|
print "in your PATH.\n"; |
|
|
|
exit(1); |
|
|
|
@ -265,17 +265,17 @@ sub init_log |
|
|
|
} |
|
|
|
|
|
|
|
#### |
|
|
|
#### Report living and not running MySQL servers |
|
|
|
#### Report living and not running MariaDB servers |
|
|
|
#### |
|
|
|
|
|
|
|
sub report_mysqlds |
|
|
|
{ |
|
|
|
my (@groups, $com, $i, @options, $pec); |
|
|
|
|
|
|
|
print "Reporting MySQL servers\n"; |
|
|
|
print "Reporting MariaDB servers\n"; |
|
|
|
if (!$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("\nReporting MySQL servers","$opt_log",0,0); |
|
|
|
w2log("\nReporting MariaDB servers","$opt_log",0,0); |
|
|
|
} |
|
|
|
@groups = &find_groups($groupids); |
|
|
|
for ($i = 0; defined($groups[$i]); $i++) |
|
|
|
@ -286,19 +286,19 @@ sub report_mysqlds |
|
|
|
$pec = $? >> 8; |
|
|
|
if ($pec) |
|
|
|
{ |
|
|
|
print "MySQL server from group: $groups[$i] is not running\n"; |
|
|
|
print "MariaDB server from group: $groups[$i] is not running\n"; |
|
|
|
if (!$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("MySQL server from group: $groups[$i] is not running", |
|
|
|
w2log("MariaDB server from group: $groups[$i] is not running", |
|
|
|
"$opt_log", 0, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
print "MySQL server from group: $groups[$i] is running\n"; |
|
|
|
print "MariaDB server from group: $groups[$i] is running\n"; |
|
|
|
if (!$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("MySQL server from group: $groups[$i] is running", |
|
|
|
w2log("MariaDB server from group: $groups[$i] is running", |
|
|
|
"$opt_log", 0, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -323,11 +323,11 @@ sub start_mysqlds() |
|
|
|
|
|
|
|
if (!$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("\nStarting MySQL servers\n","$opt_log",0,0); |
|
|
|
w2log("\nStarting MariaDB servers\n","$opt_log",0,0); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
print "\nStarting MySQL servers\n"; |
|
|
|
print "\nStarting MariaDB servers\n"; |
|
|
|
} |
|
|
|
@groups = &find_groups($groupids); |
|
|
|
for ($i = 0; defined($groups[$i]); $i++) |
|
|
|
@ -398,7 +398,7 @@ sub start_mysqlds() |
|
|
|
} |
|
|
|
if (!$i && !$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("No MySQL servers to be started (check your GNRs)", |
|
|
|
w2log("No MariaDB servers to be started (check your GNRs)", |
|
|
|
"$opt_log", 0, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -413,11 +413,11 @@ sub stop_mysqlds() |
|
|
|
|
|
|
|
if (!$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("\nStopping MySQL servers\n","$opt_log",0,0); |
|
|
|
w2log("\nStopping MariaDB servers\n","$opt_log",0,0); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
print "\nStopping MySQL servers\n"; |
|
|
|
print "\nStopping MariaDB servers\n"; |
|
|
|
} |
|
|
|
@groups = &find_groups($groupids); |
|
|
|
for ($i = 0; defined($groups[$i]); $i++) |
|
|
|
@ -430,7 +430,7 @@ sub stop_mysqlds() |
|
|
|
} |
|
|
|
if (!$i && !$opt_no_log) |
|
|
|
{ |
|
|
|
w2log("No MySQL servers to be stopped (check your GNRs)", |
|
|
|
w2log("No MariaDB servers to be stopped (check your GNRs)", |
|
|
|
"$opt_log", 0, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -638,23 +638,23 @@ sub example |
|
|
|
# |
|
|
|
# 1.COMMON USER |
|
|
|
# |
|
|
|
# Make sure that the MySQL user, who is stopping the mysqld services, has |
|
|
|
# the same password to all MySQL servers being accessed by $my_progname. |
|
|
|
# Make sure that the MariaDB user, who is stopping the mysqld services, has |
|
|
|
# the same password to all MariaDB servers being accessed by $my_progname. |
|
|
|
# This user needs to have the 'Shutdown_priv' -privilege, but for security |
|
|
|
# reasons should have no other privileges. It is advised that you create a |
|
|
|
# common 'multi_admin' user for all MySQL servers being controlled by |
|
|
|
# common 'multi_admin' user for all MariaDB servers being controlled by |
|
|
|
# $my_progname. Here is an example how to do it: |
|
|
|
# |
|
|
|
# GRANT SHUTDOWN ON *.* TO multi_admin\@localhost IDENTIFIED BY 'password' |
|
|
|
# |
|
|
|
# You will need to apply the above to all MySQL servers that are being |
|
|
|
# You will need to apply the above to all MariaDB servers that are being |
|
|
|
# controlled by $my_progname. 'multi_admin' will shutdown the servers |
|
|
|
# using 'mysqladmin' -binary, when '$my_progname stop' is being called. |
|
|
|
# |
|
|
|
# 2.PID-FILE |
|
|
|
# |
|
|
|
# If you are using mysqld_safe to start mysqld, make sure that every |
|
|
|
# MySQL server has a separate pid-file. In order to use mysqld_safe |
|
|
|
# MariaDB server has a separate pid-file. In order to use mysqld_safe |
|
|
|
# via $my_progname, you need to use two options: |
|
|
|
# |
|
|
|
# mysqld=/path/to/mysqld_safe |
|
|
|
@ -667,7 +667,7 @@ sub example |
|
|
|
# |
|
|
|
# 3.DATA DIRECTORY |
|
|
|
# |
|
|
|
# It is NOT advised to run many MySQL servers within the same data directory. |
|
|
|
# It is NOT advised to run many MariaDB servers within the same data directory. |
|
|
|
# You can do so, but please make sure to understand and deal with the |
|
|
|
# underlying caveats. In short they are: |
|
|
|
# - Speed penalty |
|
|
|
@ -688,7 +688,7 @@ sub example |
|
|
|
# intentionally left out. You may have 'gaps' in the config file. This |
|
|
|
# gives you more flexibility. |
|
|
|
# |
|
|
|
# 6.MySQL Server User |
|
|
|
# 6.MariaDB Server User |
|
|
|
# |
|
|
|
# You can pass the user=... option inside [mysqld#] groups. This |
|
|
|
# can be very handy in some cases, but then you need to run $my_progname |
|
|
|
@ -696,7 +696,7 @@ sub example |
|
|
|
# |
|
|
|
# 7.A Start-up Manage Script for $my_progname |
|
|
|
# |
|
|
|
# In the recent MySQL distributions you can find a file called |
|
|
|
# In the recent MariaDB distributions you can find a file called |
|
|
|
# mysqld_multi.server.sh. It is a wrapper for $my_progname. This can |
|
|
|
# be used to start and stop multiple servers during boot and shutdown. |
|
|
|
# |
|
|
|
@ -709,7 +709,7 @@ sub example |
|
|
|
# or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups. |
|
|
|
# |
|
|
|
# The script can be found from support-files/mysqld_multi.server.sh |
|
|
|
# in MySQL distribution. (Verify the script before using) |
|
|
|
# in MariaDB distribution. (Verify the script before using) |
|
|
|
# |
|
|
|
|
|
|
|
[mysqld_multi] |
|
|
|
@ -828,7 +828,7 @@ Using: @{[join ' ', @defaults_options]} |
|
|
|
file is turned on. |
|
|
|
--password=... Password for mysqladmin user. |
|
|
|
--silent Disable warnings. |
|
|
|
--tcp-ip Connect to the MySQL server(s) via the TCP/IP port instead |
|
|
|
--tcp-ip Connect to the MariaDB server(s) via the TCP/IP port instead |
|
|
|
of the UNIX socket. This affects stopping and reporting. |
|
|
|
If a socket file is missing, the server may still be |
|
|
|
running, but can be accessed only via the TCP/IP port. |
|
|
|
|