Commit 097180ef authored by Michael Widenius's avatar Michael Widenius

Ensure that the last --datadir option is used from the my.cnf files.

scripts/mysqldumpslow.sh:
  Remove not used --basedir option
  Ensure that the last --datadir option is used from the my.cnf files.
parent 35cc5ea0
...@@ -35,11 +35,8 @@ $opt{'help'} and usage(); ...@@ -35,11 +35,8 @@ $opt{'help'} and usage();
unless (@ARGV) { unless (@ARGV) {
my $defaults = `my_print_defaults mysqld`; my $defaults = `my_print_defaults mysqld`;
my $basedir = ($defaults =~ m/--basedir=(.*)/)[0]
or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults";
warn "basedir=$basedir\n" if $opt{v};
my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; my $datadir = ($defaults =~ m/--datadir=(.*)/g)[-1];
my $slowlog = ($defaults =~ m/--log-slow-queries=(.*)/)[0]; my $slowlog = ($defaults =~ m/--log-slow-queries=(.*)/)[0];
if (!$datadir or $opt{i}) { if (!$datadir or $opt{i}) {
# determine the datadir from the instances section of /etc/my.cnf, if any # determine the datadir from the instances section of /etc/my.cnf, if any
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment