summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_fix_privilege_tables.sh18
-rw-r--r--scripts/mysqlhotcopy.sh5
2 files changed, 20 insertions, 3 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index bf7f082203d..d4291e7f496 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -10,6 +10,9 @@ sql_only=0
basedir=""
verbose=0
args=""
+port=""
+socket=""
+database="mysql"
file=mysql_fix_privilege_tables.sql
@@ -34,6 +37,9 @@ parse_arguments() {
--host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--sql|--sql-only) sql_only=1;;
--verbose) verbose=1 ;;
+ --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
+ --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
+ --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
*)
if test -n "$pick_args"
then
@@ -93,11 +99,19 @@ then
password=`echo $args | sed -e 's/ *//g'`
fi
+cmd="$bindir/mysql -f --user=$user --host=$host"
if test -z "$password" ; then
- cmd="$bindir/mysql -f --user=$user --host=$host mysql"
else
- cmd="$bindir/mysql -f --user=$user --password=$password --host=$host mysql"
+ cmd="$cmd --password=$password"
fi
+if test ! -z "$port"; then
+ cmd="$cmd --port=$port"
+fi
+if test ! -z "$socket"; then
+ cmd="$cmd --socket=$socket"
+fi
+cmd="$cmd --database=$database"
+
if test $sql_only = 1
then
cmd="cat"
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 654e5466e12..ab06215c3ac 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
-my $VERSION = "1.20";
+my $VERSION = "1.21";
my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";
@@ -73,6 +73,7 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory]
--resetslave reset the master.info once all tables are locked
--tmpdir=# temporary directory (instead of $opt_tmpdir)
--record_log_pos=# record slave and master status in specified db.table
+ --chroot=# base directory of chroot jail in which mysqld operates
Try \'perldoc $0 for more complete documentation\'
_OPTIONS
@@ -117,6 +118,7 @@ GetOptions( \%opt,
"resetslave",
"tmpdir|t=s",
"dryrun|n",
+ "chroot=s",
) or usage("Invalid option");
# @db_desc
@@ -210,6 +212,7 @@ while ( my ($var,$value) = $sth_vars->fetchrow_array ) {
}
my $datadir = $mysqld_vars{'datadir'}
|| die "datadir not in mysqld variables";
+ $datadir= $opt{chroot}.$datadir if ($opt{chroot});
$datadir =~ s:/$::;