diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/make_binary_distribution.sh | 149 | ||||
-rwxr-xr-x | scripts/make_win_bin_dist | 44 | ||||
-rw-r--r-- | scripts/mysql_convert_table_format.sh | 81 | ||||
-rw-r--r-- | scripts/mysql_find_rows.sh | 2 | ||||
-rw-r--r-- | scripts/mysql_fix_extensions.sh | 2 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 56 | ||||
-rw-r--r-- | scripts/mysql_secure_installation.sh | 163 | ||||
-rw-r--r-- | scripts/mysql_setpermission.sh | 4 | ||||
-rw-r--r-- | scripts/mysql_system_tables.sql | 2 | ||||
-rw-r--r-- | scripts/mysql_system_tables_fix.sql | 4 | ||||
-rw-r--r-- | scripts/mysql_zap.sh | 6 | ||||
-rw-r--r-- | scripts/mysqlaccess.sh | 2 | ||||
-rw-r--r-- | scripts/mysqld_multi.sh | 35 | ||||
-rw-r--r-- | scripts/mysqld_safe.sh | 18 | ||||
-rw-r--r-- | scripts/mysqldumpslow.sh | 11 | ||||
-rw-r--r-- | scripts/mysqlhotcopy.sh | 60 |
16 files changed, 485 insertions, 154 deletions
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index ee7c36b097d..8c965832cf7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -56,6 +56,12 @@ SOURCE=`pwd` CP="cp -p" MV="mv" +# There are platforms, notably OS X on Intel (x86 + x86_64), +# for which "uname" does not provide sufficient information. +# The value of CFLAGS as used during compilation is the most exact info +# we can get - after all, we care about _what_ we built, not _where_ we did it. +cflags="@CFLAGS@" + STRIP=1 # Option ignored SILENT=0 PLATFORM="" @@ -104,7 +110,50 @@ if [ x"$PLATFORM" = x"" ] ; then system=`echo $system | sed -e 's/linux-gnu/linux/g'` system=`echo $system | sed -e 's/solaris2.\([0-9]*\)/solaris\1/g'` system=`echo $system | sed -e 's/sco3.2v\(.*\)/openserver\1/g'` +fi + +# Get the "machine", which really is the CPU architecture (including the size). +# The precedence is: +# 1) use an explicit argument, if given; +# 2) use platform-specific fixes, if there are any (see bug#37808); +# 3) stay with the default (determined during "configure", using predefined macros). + +if [ x"$MACHINE" != x"" ] ; then + machine=$MACHINE +else + case $system in + osx* ) + # Extract "XYZ" from CFLAGS "... -arch XYZ ...", or empty! + cflag_arch=`echo "$cflags" | sed -n -e 's=.* -arch \([^ ]*\) .*=\1=p'` + case "$cflag_arch" in + i386 ) case $system in + osx10.4 ) machine=i686 ;; # Used a different naming + * ) machine=x86 ;; + esac ;; + x86_64 ) machine=x86_64 ;; + ppc ) ;; # No treatment needed with PPC + ppc64 ) ;; + * ) # No matching compiler flag? "--platform" is needed + if [ x"$PLATFORM" != x"" ] ; then + : # See below: "$PLATFORM" will take precedence anyway + elif [ "$system" = "osx10.3" -a -z "$cflag_arch" ] ; then + : # Special case of OS X 10.3, which is PPC-32 only and doesn't use "-arch" + else + echo "On system '$system' only specific '-arch' values are expected." + echo "It is taken from the 'CFLAGS' whose value is:" + echo "$cflags" + echo "'-arch $cflag_arch' is unexpected, and no '--platform' was given: ABORT" + exit 1 + fi ;; + esac # "$cflag_arch" + ;; + esac # $system +fi +# Combine OS and CPU to the "platform". Again, an explicit argument takes precedence. +if [ x"$PLATFORM" != x"" ] ; then + : +else PLATFORM="$system-$machine" fi @@ -116,10 +165,15 @@ case $PLATFORM in esac # Change the distribution to a long descriptive name +# For the cluster product, concentrate on the second part +VERSION_NAME=@VERSION@ +case $VERSION_NAME in + *-ndb-* ) VERSION_NAME=`echo $VERSION_NAME | sed -e 's/[.0-9]*-ndb-//'` ;; +esac if [ x"$SHORT_PRODUCT_TAG" != x"" ] ; then - NEW_NAME=mysql-$SHORT_PRODUCT_TAG-@VERSION@-$PLATFORM$SUFFIX + NEW_NAME=mariadb-$SHORT_PRODUCT_TAG-$VERSION_NAME-$PLATFORM$SUFFIX else - NEW_NAME=mysql@MYSQL_SERVER_SUFFIX@-@VERSION@-$PLATFORM$SUFFIX + NEW_NAME=mariadb@MYSQL_SERVER_SUFFIX@-$VERSION_NAME-$PLATFORM$SUFFIX fi # ---------------------------------------------------------------------- @@ -148,10 +202,10 @@ which_1 () do for file in $d/$cmd do - if [ -x $file -a ! -d $file ] ; then - echo $file - exit 0 - fi + if [ -x $file -a ! -d $file ] ; then + echo $file + exit 0 + fi done done done @@ -177,6 +231,18 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then # ---------------------------------------------------------------------- set -e + # + # Check that the client is compiled with libmysqlclient.a + # + if test -f ./client/.libs/mysql + then + echo "" + echo "The MySQL clients are compiled dynamicly, which is not allowed for" + echo "a MySQL binary tar file. Please configure with" + echo "--with-client-ldflags=-all-static and try again" + exit 1; + fi + # ---------------------------------------------------------------------- # Really ugly, one script, "mysql_install_db", needs prefix set to ".", # i.e. makes access relative the current directory. This matches @@ -185,8 +251,8 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then # ---------------------------------------------------------------------- cd scripts - rm -f mysql_install_db - @MAKE@ mysql_install_db \ + rm -f mysql_install_db mysqld_safe mysql_fix_privilege_tables + @MAKE@ mysql_install_db mysqld_safe mysql_fix_privilege_tables \ prefix=. \ bindir=./bin \ sbindir=./bin \ @@ -203,7 +269,7 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then sbindir=./bin \ scriptdir=./bin \ libexecdir=./bin \ - pkgdatadir=@pkgdatadir@ + pkgdatadir=./share cd .. # ---------------------------------------------------------------------- @@ -239,11 +305,6 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then fi fi - # FIXME let this script be in "bin/", where it is in the RPMs? - # http://dev.mysql.com/doc/refman/5.1/en/mysql-install-db-problems.html - mkdir $DEST/scripts - mv $DEST/bin/mysql_install_db $DEST/scripts/ - # Note, no legacy "safe_mysqld" link to "mysqld_safe" in 5.1 # Copy readme and license files @@ -266,6 +327,40 @@ if [ x"$BASE_SYSTEM" != x"netware" ] ; then mkdir $DEST/data $DEST/data/mysql $DEST/data/test chmod o-rwx $DEST/data $DEST/data/mysql $DEST/data/test + # Remove not needed files + rm $DEST/share/mysql/errmsg.txt + + # Remove NDB files + rm -f $DEST/share/mysql/ndb-config-2-node.ini \ + $DEST/share/mysql/config* + + # + # Move things to make them easier to find in tar installation + # + + # The following test is needed if the original configure was done with + # something like --libexecdir=/usr/local/mysql/bin + if test -f $DEST/libexec/mysqld + then + mv $DEST/libexec/* $DEST/bin + rmdir $DEST/libexec + fi + mv $DEST/share/man $DEST + mv $DEST/share/mysql/binary-configure $DEST/configure + mv $DEST/share/mysql/*.sql $DEST/share + mv $DEST/share/mysql/*.cnf $DEST/share/mysql/*.server $DEST/share/mysql/mysql-log-rotate $DEST/support-files + + # + # Move some scripts that are only run once to 'scripts' directory + # but add symbolic links instead to old place for compatibility + # + mkdir $DEST/scripts + for i in mysql_secure_installation mysql_fix_extensions mysql_fix_privilege_tables mysql_install_db + do + mv $DEST/bin/$i $DEST/scripts + ln -s "../scripts/$i" $DEST/bin/$i + done + # ---------------------------------------------------------------------- # Create the result tar file # ---------------------------------------------------------------------- @@ -335,6 +430,9 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \ storage/myisam/myisamchk$BS storage/myisam/myisampack$BS \ storage/myisam/myisamlog$BS storage/myisam/myisam_ftdump$BS \ + storage/maria/maria_chk$BS storage/maria/maria_pack$BS \ + storage/maria/maria_ftdump$BS storage/maria/maria_read_log$BS \ + storage/maria/maria_dump_log$BS \ sql/mysqld$BS sql/mysqld-debug$BS \ sql/mysql_tzinfo_to_sql$BS \ server-tools/instance-manager/mysqlmanager$BS \ @@ -439,12 +537,21 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh \ $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution \ $BASE/bin/make_win_* \ $BASE/bin/setsomevars $BASE/support-files/Makefile* \ - $BASE/support-files/*.sh + $BASE/support-files/*.sh \ + $BASE/share/mysql/errmsg.txt + +# Remove NDB files +rm -f $BASE/share/ndb-config-2-node.ini \ + $BASE/share/mysql/config* # -# Copy system dependent files +# Move things to make things easier to find in tar installation # -./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql + +mv $BASE/share/man $BASE +mv $BASE/share/mysql/binary-configure $BASE/configure +mv $BASE/share/mysql/*.sql $BASE/share +mv $BASE/share/mysql/*.cnf $BASE/share/mysql/*.server $BASE/share/mysql/mysql-log-rotate $BASE/support-files # # Remove system dependent files @@ -455,15 +562,9 @@ rm -f $BASE/support-files/magic \ $BASE/support-files/mysql-log-rotate \ $BASE/support-files/binary-configure \ $BASE/support-files/build-tags \ - $BASE/support-files/MySQL-shared-compat.spec \ + $BASE/support-files/MySQL-shared-compat.spec \ $BASE/INSTALL-BINARY -# Clean up if we did this from a bk tree -if [ -d $BASE/sql-bench/SCCS ] ; then - find $BASE/share -name SCCS -print | xargs rm -rf - find $BASE/sql-bench -name SCCS -print | xargs rm -rf -fi - BASE2=$TMP/$NEW_NAME rm -rf $BASE2 mv $BASE $BASE2 diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 5eb5a5643f1..11f627b4276 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -126,7 +126,7 @@ if [ -e $DESTDIR ] ; then usage fi -trap 'echo "Clearning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR +trap 'echo "Cleaning up and exiting..." ; rm -fr $DESTDIR; exit 1' ERR # ---------------------------------------------------------------------- # Adjust target name if needed, release with debug info has another name @@ -140,12 +140,24 @@ fi # ---------------------------------------------------------------------- # Copy executables, and client DLL # ---------------------------------------------------------------------- - +MYISAM_BINARIES="myisamchk myisamlog myisampack myisam_ftdump" +MARIA_BINARIES="maria_chk maria_dump_log maria_ftdump maria_pack maria_read_log" mkdir $DESTDIR mkdir $DESTDIR/bin cp client/$TARGET/*.exe $DESTDIR/bin/ cp extra/$TARGET/*.exe $DESTDIR/bin/ -cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ + +# MyISAM +#cp storage/myisam/$TARGET/*.exe $DESTDIR/bin/ +for eng in $MYISAM_BINARIES ; do + cp storage/myisam/$TARGET/$eng.{exe,pdb} $DESTDIR/bin +done + +# Maria +for eng in $MARIA_BINARIES ; do + cp storage/maria/$TARGET/$eng.{exe,pdb} $DESTDIR/bin +done + cp server-tools/instance-manager/$TARGET/*.{exe,map} $DESTDIR/bin/ if [ x"$TARGET" != x"release" ] ; then cp server-tools/instance-manager/$TARGET/*.pdb $DESTDIR/bin/ @@ -279,6 +291,8 @@ cp include/mysql/plugin.h $DESTDIR/include/mysql/ # ---------------------------------------------------------------------- mkdir -p $DESTDIR/lib/opt +mkdir -p $DESTDIR/lib/plugin +cp sql/$TARGET/mysqld.lib $DESTDIR/lib/ cp libmysql/$TARGET/libmysql.dll \ libmysql/$TARGET/libmysql.lib \ libmysql/$TARGET/mysqlclient.lib \ @@ -286,6 +300,10 @@ cp libmysql/$TARGET/libmysql.dll \ regex/$TARGET/regex.lib \ strings/$TARGET/strings.lib \ zlib/$TARGET/zlib.lib $DESTDIR/lib/opt/ +if [ -d storage/innodb_plugin ]; then + cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.dll \ + $DESTDIR/lib/plugin/ +fi if [ x"$TARGET" != x"release" ] ; then cp libmysql/$TARGET/libmysql.pdb \ @@ -294,11 +312,17 @@ if [ x"$TARGET" != x"release" ] ; then regex/$TARGET/regex.pdb \ strings/$TARGET/strings.pdb \ zlib/$TARGET/zlib.pdb $DESTDIR/lib/opt/ + if [ -d storage/innodb_plugin ]; then + cp storage/innodb_plugin/$TARGET/ha_innodb_plugin.pdb \ + $DESTDIR/lib/plugin/ + fi fi + if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ x"$PACK_DEBUG" = x"yes" ] ; then mkdir -p $DESTDIR/lib/debug + mkdir -p $DESTDIR/lib/plugin/debug cp libmysql/debug/libmysql.dll \ libmysql/debug/libmysql.lib \ libmysql/debug/libmysql.pdb \ @@ -312,6 +336,12 @@ if [ x"$PACK_DEBUG" = x"" -a -f "libmysql/debug/libmysql.lib" -o \ strings/debug/strings.pdb \ zlib/debug/zlib.lib \ zlib/debug/zlib.pdb $DESTDIR/lib/debug/ + if [ -d storage/innodb_plugin ]; then + cp storage/innodb_plugin/debug/ha_innodb_plugin.dll \ + storage/innodb_plugin/debug/ha_innodb_plugin.lib \ + storage/innodb_plugin/debug/ha_innodb_plugin.pdb \ + $DESTDIR/lib/plugin/debug/ + fi fi # ---------------------------------------------------------------------- @@ -320,9 +350,15 @@ fi mkdir $DESTDIR/mysql-test cp mysql-test/mysql-test-run.pl $DESTDIR/mysql-test/ +cp mysql-test/mysql-stress-test.pl $DESTDIR/mysql-test/ cp mysql-test/README $DESTDIR/mysql-test/ cp -R mysql-test/{t,r,include,suite,std_data,lib} $DESTDIR/mysql-test/ +rm -rf $DESTDIR/mysql-test/lib/My/SafeProcess/my_safe_kill.{dir,vcproj} +rm -rf $DESTDIR/mysql-test/lib/My/SafeProcess/my_safe_process.{dir,vcproj} +rm -rf $DESTDIR/mysql-test/lib/My/SafeProcess/{Debug,RelWithDebInfo}/*.{ilk,idb,map} + + # Note that this will not copy "extra" if a soft link if [ -d mysql-test/extra ] ; then mkdir $DESTDIR/mysql-test/extra @@ -361,7 +397,7 @@ cp scripts/*.sql $DESTDIR/share/ # Clean up from possibly copied SCCS directories # ---------------------------------------------------------------------- -rm -rf `find $DISTDIR -type d -name SCCS -print` +rm -rf `/bin/find $DISTDIR -type d -name SCCS -print` # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE diff --git a/scripts/mysql_convert_table_format.sh b/scripts/mysql_convert_table_format.sh index d15c7b28410..6f586d0e8e0 100644 --- a/scripts/mysql_convert_table_format.sh +++ b/scripts/mysql_convert_table_format.sh @@ -23,18 +23,30 @@ $opt_help=$opt_version=$opt_verbose=$opt_force=0; $opt_user=$opt_database=$opt_password=undef; $opt_host="localhost"; $opt_socket=""; -$opt_type="MYISAM"; +$opt_engine="MYISAM"; $opt_port=0; $exit_status=0; -GetOptions("force","help","host=s","password=s","user=s","type=s","verbose","version","socket=s", "port=i") || - usage(0); +GetOptions( + "e|engine|type=s" => \$opt_type, + "f|force" => \$opt_force, + "help|?" => \$opt_help, + "h|host=s" => \$opt_host, + "p|password=s" => \$opt_password, + "u|user=s" => \$opt_user, + "v|verbose" => \$opt_verbose, + "V|version" => \$opt_version, + "S|socket=s" => \$opt_socket, + "P|port=i" => \$opt_port +) || usage(0); + usage($opt_version) if ($#ARGV < 0 || $opt_help || $opt_version); + $opt_database=shift(@ARGV); -if (uc($opt_type) eq "HEAP") +if (grep { /^$opt_engine$/i } qw(HEAP MEMORY BLACKHOLE)) { - print "Converting to type HEAP would delete your tables; aborting\n"; + print "Converting to '$opt_engine' would delete your data; aborting\n"; exit(1); } @@ -54,21 +66,29 @@ $dbh = DBI->connect("DBI:mysql:$opt_database:${opt_host}$connect_opt", { PrintError => 0}) || die "Can't connect to database $opt_database: $DBI::errstr\n"; -if ($#ARGV < 0) +my @tables; + +push(@ARGV, "%") if(!@ARGV); + +foreach $pattern (@ARGV) { - # Fetch all table names from the database my ($sth,$row); - $sth=$dbh->prepare("show tables"); - $sth->execute || die "Can't get tables from $opt_database; $DBI::errstr\n"; + $sth=$dbh->prepare("SHOW TABLES LIKE ?"); + $rv= $sth->execute($pattern); + if(!int($rv)) + { + warn "Can't get tables matching '$pattern' from $opt_database; $DBI::errstr\n"; + exit(1) unless $opt_force; + } while (($row = $sth->fetchrow_arrayref)) { - push(@ARGV,$row->[0]); + push(@tables, $row->[0]); } $sth->finish; } print "Converting tables:\n" if ($opt_verbose); -foreach $table (@ARGV) +foreach $table (@tables) { my ($sth,$row); @@ -76,14 +96,15 @@ foreach $table (@ARGV) $sth=$dbh->prepare("show table status like '$table'"); if ($sth->execute && ($row = $sth->fetchrow_arrayref)) { - if (uc($row->[1]) eq uc($opt_type)) + if (uc($row->[1]) eq uc($opt_engine)) { - print "$table is already of type $opt_type; Ignored\n"; + print "$table already uses the '$opt_engine' engine; Ignored\n"; next; } } print "converting $table\n" if ($opt_verbose); - if (!$dbh->do("ALTER TABLE $table ENGINE=$opt_type")) + $table=~ s/`/``/g; + if (!$dbh->do("ALTER TABLE `$table` ENGINE=$opt_engine")) { print STDERR "Can't convert $table: Error $DBI::errstr\n"; exit(1) if (!$opt_force); @@ -103,43 +124,43 @@ sub usage print <<EOF; -Conversion of a MySQL tables to other table types. +Conversion of a MySQL tables to other storage engines - Usage: $0 database [tables] + Usage: $0 database [table[ table ...]] If no tables has been specifed, all tables in the database will be converted. + You can also use wildcards, ie "my%" The following options are available: ---force +-f, --force Continue even if there is some error. ---help or --Information +-?, --help Shows this help ---host='host name' (Default $opt_host) - Host name where the database server is located. +-e, --engine=ENGINE + Converts tables to the given storage engine (Default: $opt_engine) ---password='password' +-h, --host=HOST + Host name where the database server is located. (Default: $opt_host) + +-p, --password=PASSWORD Password for the current user. ---port=port +-P, --port=PORT TCP/IP port to connect to if host is not "localhost". ---socket='/path/to/socket' +-S, --socket=SOCKET Socket to connect with. ---ENGINE='table-type' - Converts tables to the given table type (Default: $opt_type) - MySQL 3.23 supports at least the BDB, ISAM and MYISAM types. - ---user='user_name' +-u, --user=USER User name to log into the SQL server. ---verbose +-v, --verbose This is a test specific option that is only used when debugging a test. Print more information about what is going on. ---version +-V, --version Shows the version of this program. EOF exit(1); diff --git a/scripts/mysql_find_rows.sh b/scripts/mysql_find_rows.sh index 77eacc8a9b4..967a8196ebd 100644 --- a/scripts/mysql_find_rows.sh +++ b/scripts/mysql_find_rows.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Copyright (C) 2000, 2004 MySQL AB # # This program is free software; you can redistribute it and/or modify diff --git a/scripts/mysql_fix_extensions.sh b/scripts/mysql_fix_extensions.sh index fbc72406f5e..6d4e017f678 100644 --- a/scripts/mysql_fix_extensions.sh +++ b/scripts/mysql_fix_extensions.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # This is a utility for MySQL. It is not needed by any standard part # of MySQL. diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 20b7973cb4e..ea00b3a183b 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2002-2003 MySQL AB +# Copyright (C) 2002-2003 MySQL AB & Monty Program Ab # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# This scripts creates the MySQL Server system tables +# This scripts creates the MariaDB Server system tables # # All unrecognized arguments to this script are passed to mysqld. @@ -38,26 +38,27 @@ usage() { cat <<EOF Usage: $0 [OPTIONS] - --basedir=path The path to the MySQL installation directory. + --basedir=path The path to the MariaDB installation directory. --builddir=path If using --srcdir with out-of-directory builds, you will need to set this to the location of the build directory where built files reside. - --cross-bootstrap For internal use. Used when building the MySQL system + --cross-bootstrap For internal use. Used when building the MariaDB system tables on a different host than the target. - --datadir=path The path to the MySQL data directory. + --datadir=path The path to the MariaDB data directory. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally use hostnames will use IP addresses. - --ldata=path The path to the MySQL data directory. Same as --datadir. + --ldata=path The path to the MariaDB data directory. Same as + --datadir. --rpm For internal use. This option is used by RPM files - during the MySQL installation process. + during the MariaDB installation process. --skip-name-resolve Use IP addresses rather than hostnames when creating grant table entries. This option can be useful if your DNS does not work. - --srcdir=path The path to the MySQL source directory. This option + --srcdir=path The path to the MariaDB source directory. This option uses the compiled binaries and support files within the source tree, useful for if you don't want to install - MySQL yet and just want to create the system tables. + MariaDB yet and just want to create the system tables. --user=user_name The login username to use for running mysqld. Files and directories created by mysqld will be owned by this user. You must be root to use this option. By default @@ -116,7 +117,7 @@ parse_arguments() defaults="$arg" ;; --cross-bootstrap|--windows) - # Used when building the MySQL system tables on a different host than + # Used when building the MariaDB system tables on a different host than # the target. The platform-independent files that are created in # --datadir on the host can be copied to the target system. # @@ -338,10 +339,10 @@ then fi echo "WARNING: The host '$hostname' could not be looked up with resolveip." echo "This probably means that your libc libraries are not 100 % compatible" - echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" + echo "with this binary MariaDB version. The MariaDB daemon, mysqld, should work" echo "normally with the exception that host name resolving will not work." echo "This means that you should use IP addresses instead of hostnames" - echo "when specifying MySQL privileges !" + echo "when specifying MariaDB privileges !" fi fi @@ -388,7 +389,7 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ --net_buffer_length=16K" # Create the system and help tables by passing them to "mysqld --bootstrap" -s_echo "Installing MySQL system tables..." +s_echo "Installing MariaDB/MySQL system tables..." if { echo "use mysql;"; cat $create_system_tables $fill_system_tables; } | eval "$filter_cmd_line" | $mysqld_install_cmd_line > /dev/null then s_echo "OK" @@ -410,14 +411,16 @@ else echo "Try 'mysqld --help' if you have problems with paths. Using --log" echo "gives you a log in $ldata that may be helpful." echo - echo "The latest information about MySQL is available on the web at" - echo "http://www.mysql.com/. Please consult the MySQL manual section" + echo "The latest information about MariaDB is available on the web at" + echo "http://askmonty.org/wiki/index.php/MariaDB". + echo "If you have a problem, you can consult the MySQL manual section" echo "'Problems running mysql_install_db', and the manual section that" - echo "describes problems on your OS. Another information source are the" - echo "MySQL email archives available at http://lists.mysql.com/." + echo "describes problems on your OS at http://dev.mysql.com/doc/" + echo "MariaDB is hosted on launchpad; You can find the latest source and" + echo "email lists at http://launchpad.net/maria" echo echo "Please check all of the above before mailing us! And remember, if" - echo "you do mail us, you MUST use the $scriptdir/mysqlbug script!" + echo "you do mail us, you should use the $scriptdir/mysqlbug script!" echo exit 1 fi @@ -442,7 +445,7 @@ then s_echo "support-files/mysql.server to the right place for your system" echo - echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" + echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !" echo "To do so, start the server, then issue the following commands:" echo echo "$bindir/mysqladmin -u root password 'new-password'" @@ -455,23 +458,28 @@ then echo "databases and anonymous user created by default. This is" echo "strongly recommended for production servers." echo - echo "See the manual for more instructions." + echo "See the MySQL manual for more instructions." if test "$in_rpm" -eq 0 then echo - echo "You can start the MySQL daemon with:" + echo "You can start the MariaDB daemon with:" echo "cd $basedir ; $bindir/mysqld_safe &" echo - echo "You can test the MySQL daemon with mysql-test-run.pl" + echo "You can test the MariaDB daemon with mysql-test-run.pl" echo "cd $basedir/mysql-test ; perl mysql-test-run.pl" fi echo echo "Please report any problems with the $scriptdir/mysqlbug script!" echo - echo "The latest information about MySQL is available at http://www.mysql.com/" - echo "Support MySQL by buying support/licenses from http://shop.mysql.com/" + echo "The latest information about MariaDB is available at http://www.askmonty.org/." + echo "You can find additional information about the MySQL part at:" + echo "http://dev.mysql.com" + echo "Support MariaDB development by buying support/new features from" + echo "Monty Program Ab. You can contact us about this at sales@askmonty.org". + echo "Alternatively consider joining our community based development effort:" + echo "http://askmonty.org/wiki/index.php/MariaDB#How_can_I_participate_in_the_development_of_MariaDB.3F" echo fi diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 6c2d88d6d29..6985a58ce76 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -23,6 +23,157 @@ trap "interrupt" 2 rootpass="" echo_n= echo_c= +basedir= +bindir= + +parse_arg() +{ + echo "$1" | sed -e 's/^[^=]*=//' +} + +parse_arguments() +{ + # We only need to pass arguments through to the server if we don't + # handle them here. So, we collect unrecognized options (passed on + # the command line) into the args variable. + pick_args= + if test "$1" = PICK-ARGS-FROM-ARGV + then + pick_args=1 + shift + fi + + for arg + do + case "$arg" in + --basedir=*) basedir=`parse_arg "$arg"` ;; + --no-defaults|--defaults-file=*|--defaults-extra-file=*) + defaults="$arg" ;; + *) + if test -n "$pick_args" + then + # This sed command makes sure that any special chars are quoted, + # so the arg gets passed exactly to the server. + # XXX: This is broken; true fix requires using eval and proper + # quoting of every single arg ($basedir, $ldata, etc.) + #args="$args "`echo "$arg" | sed -e 's,\([^a-zA-Z0-9_.-]\),\\\\\1,g'` + args="$args $arg" + fi + ;; + esac + done +} + +# Try to find a specific file within --basedir which can either be a binary +# release or installed source directory and return the path. +find_in_basedir() +{ + return_dir= + case "$1" in + --dir) + return_dir=1; shift + ;; + esac + + file=$1; shift + + for dir in "$@" + do + if test -f "$basedir/$dir/$file" + then + if test -n "$return_dir" + then + echo "$basedir/$dir" + else + echo "$basedir/$dir/$file" + fi + break + fi + done +} + +cannot_find_file() +{ + echo + echo "FATAL ERROR: Could not find $1" + + shift + if test $# -ne 0 + then + echo + echo "The following directories were searched:" + echo + for dir in "$@" + do + echo " $dir" + done + fi + + echo + echo "If you compiled from source, you need to run 'make install' to" + echo "copy the software into the correct location ready for operation." + echo + echo "If you are using a binary release, you must either be at the top" + echo "level of the extracted archive, or pass the --basedir option" + echo "pointing to that location." + echo +} + +# Ok, let's go. We first need to parse arguments which are required by +# my_print_defaults so that we can execute it first, then later re-parse +# the command line to add any extra bits that we need. +parse_arguments PICK-ARGS-FROM-ARGV "$@" + +# +# We can now find my_print_defaults. This script supports: +# +# --srcdir=path pointing to compiled source tree +# --basedir=path pointing to installed binary location +# +# or default to compiled-in locations. +# + +if test -n "$basedir" +then + print_defaults=`find_in_basedir my_print_defaults bin extra` + echo "print: $print_defaults" + if test -z "$print_defaults" + then + cannot_find_file my_print_defaults $basedir/bin $basedir/extra + exit 1 + fi +else + print_defaults="@bindir@/my_print_defaults" +fi + +if test ! -x "$print_defaults" +then + cannot_find_file "$print_defaults" + exit 1 +fi + +# Now we can get arguments from the group [client] +# in the my.cfg file, then re-run to merge with command line arguments. +parse_arguments `$print_defaults $defaults client` +parse_arguments PICK-ARGS-FROM-ARGV "$@" + +# Configure paths to support files +if test -n "$basedir" +then + bindir="$basedir/bin" +elif test -f "./bin/mysql" + then + bindir="./bin" +else + bindir="@bindir@" +fi + +mysql_command=`find_in_basedir mysql $bindir` +if test -z "$print_defaults" +then + cannot_find_file mysql $bindir + exit 1 +fi set_echo_compat() { case `echo "testing\c"`,`echo -n testing` in @@ -39,7 +190,7 @@ prepare() { do_query() { echo $1 >$command - mysql --defaults-file=$config <$command + $bindir/mysql --defaults-file=$config <$command return $? } @@ -185,14 +336,9 @@ prepare set_echo_compat echo -echo -echo -echo echo "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL" echo " SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!" echo -echo - echo "In order to log into MySQL to secure it, we'll need the current" echo "password for the root user. If you've just installed MySQL, and" echo "you haven't set the root password yet, the password will be blank," @@ -310,13 +456,8 @@ echo cleanup echo -echo -echo echo "All done! If you've completed all of the above steps, your MySQL" echo "installation should now be secure." echo echo "Thanks for using MySQL!" -echo -echo - diff --git a/scripts/mysql_setpermission.sh b/scripts/mysql_setpermission.sh index 1f5509f9955..5fa6b969e39 100644 --- a/scripts/mysql_setpermission.sh +++ b/scripts/mysql_setpermission.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl ## Emacs, this is -*- perl -*- mode? :-) ## ## Permission setter for MySQL @@ -257,7 +257,7 @@ sub addall { $sth = $dbh->do("GRANT ALL ON $db.* TO \'$user\'\@\'$host\' IDENTIFIED BY \'$pass\'") || die $dbh->errstr; } elsif ($todo == 7) { # all privileges set to N - $sth = $dbh->do("REVOKE ALL ON *.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr; + $sth = $dbh->do("REVOKE ALL ON $db.* FROM \'$user\'\@\'$host\'") || die $dbh->errstr; } } $dbh->do("FLUSH PRIVILEGES") || print STDERR "Can't flush privileges\n"; diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index 67e18517915..923497b0ab2 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint sign CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob DEFAULT '' NOT NULL, body longblob NOT NULL, definer char(77) collate utf8_bin DEFAULT '' NOT NULL, created timestamp, modified timestamp, sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'NOT_USED', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; -CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; +CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -- Create general_log if CSV is enabled. diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index a6497f57f0a..1844860c84d 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -337,6 +337,10 @@ ALTER TABLE procs_priv MODIFY Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER IGNORE TABLE procs_priv + MODIFY Routine_name char(64) + COLLATE utf8_general_ci DEFAULT '' NOT NULL; + ALTER TABLE procs_priv ADD Routine_type enum('FUNCTION','PROCEDURE') COLLATE utf8_general_ci NOT NULL AFTER Routine_name; diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh index 6c05afb772c..f78212e2578 100644 --- a/scripts/mysql_zap.sh +++ b/scripts/mysql_zap.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # Copyright (C) 2000-2002, 2004 MySQL AB # # This program is free software; you can redistribute it and/or modify @@ -27,8 +27,8 @@ $opt_f= 0; $opt_t= 0; $opt_a = ""; -$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4" || $^O eq 'darwin'; -$LINUX = $^O eq 'linux'; +$BSD = -f '/vmunix' || $ENV{"OS"} eq "SunOS4"; +$LINUX = $^O eq 'linux' || $^O eq 'darwin'; $pscmd = $BSD ? "/bin/ps -auxww" : $LINUX ? "/bin/ps axuw" : "/bin/ps -ef"; open(TTYIN, "</dev/tty") || die "can't read /dev/tty: $!"; diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index bcaf9f8af8e..0153a3afa7c 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -1,4 +1,4 @@ -#!@PERL@ +#!/usr/bin/perl # **************************** package MySQLaccess; #use strict; diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh index 631e1e38cc7..430c74874eb 100644 --- a/scripts/mysqld_multi.sh +++ b/scripts/mysqld_multi.sh @@ -1,7 +1,7 @@ #!/usr/bin/perl use Getopt::Long; -use POSIX qw(strftime); +use POSIX qw(strftime getcwd); $|=1; $VER="2.16"; @@ -293,13 +293,9 @@ sub start_mysqlds() @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { - # Defaults are made explicit parameters to server execution... @options = defaults_for_group($groups[$i]); - # ...so server MUST NOT try to read again from some config file, especially - # as the "right" file may be unknown to the server if we are using - # --defaults-file=... params in here. - unshift(@options,"--no-defaults"); + $basedir_found= 0; # The default $mysqld_found= 1; # The default $mysqld_found= 0 if (!length($mysqld)); $com= "$mysqld"; @@ -315,17 +311,25 @@ sub start_mysqlds() $com= $options[$j]; $mysqld_found= 1; } + elsif ("--basedir=" eq substr($options[$j], 0, 10)) + { + $basedir= $options[$j]; + $basedir =~ s/^--basedir=//; + $basedir_found= 1; + $options[$j]= quote_shell_word($options[$j]); + $tmp.= " $options[$j]"; + } else { $options[$j]= quote_shell_word($options[$j]); $tmp.= " $options[$j]"; } } - if ($opt_verbose && $com =~ m/\/safe_mysqld$/ && !$info_sent) + if ($opt_verbose && $com =~ m/\/(safe_mysqld|mysqld_safe)$/ && !$info_sent) { - print "WARNING: safe_mysqld is being used to start mysqld. In this case you "; + print "WARNING: $1 is being used to start mysqld. In this case you "; print "may need to pass\n\"ledir=...\" under groups [mysqldN] to "; - print "safe_mysqld in order to find the actual mysqld binary.\n"; + print "$1 in order to find the actual mysqld binary.\n"; print "ledir (library executable directory) should be the path to the "; print "wanted mysqld binary.\n\n"; $info_sent= 1; @@ -342,7 +346,16 @@ sub start_mysqlds() print "group [$groups[$i]] separately.\n"; exit(1); } + if ($basedir_found) + { + $curdir=getcwd(); + chdir($basedir) or die "Can't change to datadir $basedir"; + } system($com); + if ($basedir_found) + { + chdir($curdir) or die "Can't change back to original dir $curdir"; + } } if (!$i && !$opt_no_log) { @@ -675,9 +688,9 @@ language = @datadir@/mysql/english user = unix_user1 [mysqld3] -mysqld = /path/to/safe_mysqld/safe_mysqld +mysqld = /path/to/mysqld_safe ledir = /path/to/mysqld-binary/ -mysqladmin = /path/to/mysqladmin/mysqladmin +mysqladmin = /path/to/mysqladmin socket = /tmp/mysql.sock3 port = 3308 pid-file = @localstatedir@3/hostname.pid3 diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 960c3e39bab..23b5efcaf2b 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -67,7 +67,7 @@ my_which () ret=0 for file do - for dir in "$PATH" + for dir in $PATH do if [ -f "$dir/$file" ] then @@ -391,8 +391,8 @@ then fi # Change the err log to the right user, if it is in use if [ $want_syslog -eq 0 ]; then - touch $err_log - chown $user $err_log + touch "$err_log" + chown $user "$err_log" fi if test -n "$open_files" then @@ -509,9 +509,9 @@ fi # # If there exists an old pid file, check if the daemon is already running # Note: The switches to 'ps' may depend on your operating system -if test -f $pid_file +if test -f "$pid_file" then - PID=`cat $pid_file` + PID=`cat "$pid_file"` if @CHECK_PID@ then if @FIND_PROC@ @@ -520,8 +520,8 @@ then exit 1 fi fi - rm -f $pid_file - if test -f $pid_file + rm -f "$pid_file" + if test -f "$pid_file" then log_error "Fatal error: Can't remove the pid file: $pid_file @@ -563,11 +563,11 @@ test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" log_notice "Starting $MYSQLD daemon with databases from $DATADIR" while true do - rm -f $safe_mysql_unix_port $pid_file # Some extra safety + rm -f $safe_mysql_unix_port "$pid_file" # Some extra safety eval_log_error "$cmd" - if test ! -f $pid_file # This is removed if normal shutdown + if test ! -f "$pid_file" # This is removed if normal shutdown then break fi diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh index ce2670b2abd..8580b8e6203 100644 --- a/scripts/mysqldumpslow.sh +++ b/scripts/mysqldumpslow.sh @@ -20,7 +20,7 @@ GetOptions(\%opt, 'v|verbose+',# verbose 'help+', # write usage info 'd|debug+', # debug - 's=s', # what to sort by (t, at, l, al, r, ar etc) + 's=s', # what to sort by (al, at, ar, c, t, l, r) 'r!', # reverse the sort order (largest last instead of first) 't=i', # just show the top n queries 'a!', # don't abstract all numbers to N and strings to 'S' @@ -163,7 +163,14 @@ Parse and summarize the MySQL slow query log. Options are -v verbose -d debug - -s ORDER what to sort by (t, at, l, al, r, ar etc), 'at' is default + -s ORDER what to sort by (al, at, ar, c, l, r, t), 'at' is default + al: average lock time + ar: average rows sent + at: average query time + c: count + l: lock time + r: rows sent + t: query time -r reverse the sort order (largest last instead of first) -t NUM just show the top n queries -a don't abstract all numbers to N and strings to 'S' diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index 4819f512a65..21fca0c0848 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -49,11 +49,11 @@ $0 Ver $VERSION Usage: $0 db_name[./table_regex/] [new_db_name | directory] - -?, --help display this helpscreen and exit + -?, --help display this help-screen and exit -u, --user=# user for database login if not current user -p, --password=# password to use when connecting to server (if not set in my.cnf, which is recommended) - -h, --host=# Hostname for local server when connecting over TCP/IP + -h, --host=# hostname for local server when connecting over TCP/IP -P, --port=# port to use when connecting to local server with TCP/IP -S, --socket=# socket to use when connecting to local server @@ -86,7 +86,7 @@ sub usage { # 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). +# at all, the defaults will be used (login name, no password). my %opt = ( noindices => 0, @@ -95,7 +95,7 @@ my %opt = ( method => "cp", flushlog => 0, ); -Getopt::Long::Configure(qw(no_ignore_case)); # disambuguate -p and -P +Getopt::Long::Configure(qw(no_ignore_case)); # disambiguate -p and -P GetOptions( \%opt, "help", "host|h=s", @@ -453,7 +453,7 @@ else { printf "Locked $num_tables tables in %d seconds.\n", time-$start unless $opt{quiet}; $hc_started = time; # count from time lock is granted - # flush tables to make on-disk copy uptodate + # flush tables to make on-disk copy up to date $start = time; $dbh->do("FLUSH TABLES /*!32323 $hc_tables */"); printf "Flushed tables ($hc_tables) in %d seconds.\n", time-$start unless $opt{quiet}; @@ -895,7 +895,7 @@ tables and you don't want to have all the tables locked for the whole duration. In this situation, I<if> you are happy for groups of tables to be -backed up separately (and thus possibly not be logically consistant +backed up separately (and thus possibly not be logically consistent with one another) then you can run mysqlhotcopy several times on the same database each with different db_name./table_regex/. All but the first should use the --addtodest option so the tables @@ -920,7 +920,7 @@ server in a mutual replication setup. =item --regexp pattern -Copy all databases with names matching the pattern +Copy all databases with names matching the pattern. =item --regexp /pattern1/./pattern2/ @@ -933,7 +933,7 @@ names begin with 'bar' from all databases which names end with 'foo': =item db_name./pattern/ Copy only tables matching pattern. Shell metacharacters ( (, ), |, !, -etc.) have to be escaped (e.g. \). For example, to select all tables +etc.) have to be escaped (e.g., \). For example, to select all tables in database db1 whose names begin with 'foo' or 'bar': mysqlhotcopy --indices --method=cp db1./^\(foo\|bar\)/ @@ -947,19 +947,19 @@ that do not begin with foo nor bar: =item -?, --help -Display helpscreen and exit +Display help-screen and exit. =item -u, --user=# -user for database login if not current user +User for database login if not current user. =item -p, --password=# -password to use when connecting to the server. Note that you are strongly +Password to use when connecting to the server. Note that you are strongly encouraged *not* to use this option as every user would be able to see the password in the process list. Instead use the '[mysqlhotcopy]' section in one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf. -(See the chapter 'my.cnf Option Files' in the manual) +(See the chapter 'my.cnf Option Files' in the manual.) =item -h, -h, --host=# @@ -968,12 +968,12 @@ different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection. =item -P, --port=# -port to use when connecting to MySQL server with TCP/IP. This is only used +Port to use when connecting to MySQL server with TCP/IP. This is only used when using the --host option. =item -S, --socket=# -UNIX domain socket to use when connecting to local server +UNIX domain socket to use when connecting to local server. =item --noindices @@ -983,7 +983,7 @@ on the backup. =item --method=# -method for copy (only "cp" currently supported). Alpha support for +Method for copy (only "cp" currently supported). Alpha support for "scp" was added in November 2000. Your experience with the scp method will vary with your ability to understand how scp works. 'man scp' and 'man ssh' are your friends. @@ -1000,15 +1000,15 @@ scp or rsync the files at your leisure. =item -q, --quiet -be silent except for errors +Be silent except for errors. =item --debug -Debug messages are displayed +Debug messages are displayed. =item -n, --dryrun -Display commands without actually doing them +Display commands without actually doing them. =back @@ -1030,18 +1030,18 @@ to be specified on the command line: mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : + where ":" delimits the subsets, the /^foo_/ indicates all tables -with names begining with "foo_" and the "+" indicates all tables +with names beginning with "foo_" and the "+" indicates all tables not copied by the previous subsets. -newdb is either another not existing database or a full path to a directory -where we can create a directory 'db' +'newdb' is either the name of the new database, or the full path name +of the new database file. The database should not already exist. Add option to lock each table in turn for people who don\'t need cross-table integrity. Add option to FLUSH STATUS just before UNLOCK TABLES. -Add support for other copy methods (eg tar to single file?). +Add support for other copy methods (e.g., tar to single file?). Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. @@ -1049,26 +1049,26 @@ Add support for forthcoming MySQL ``RAID'' table subdirectory layouts. Tim Bunce -Martin Waite - added checkpoint, flushlog, regexp and dryrun options +Martin Waite - Added checkpoint, flushlog, regexp and dryrun options. Fixed cleanup of targets when hotcopy fails. - Added --record_log_pos. + Added --record_log_pos. RAID tables are now copied (don't know if this works over scp). -Ralph Corderoy - added synonyms for commands +Ralph Corderoy - Added synonyms for commands. -Scott Wiersdorf - added table regex and scp support +Scott Wiersdorf - Added table regex and scp support. -Monty - working --noindex (copy only first 2048 bytes of index file) - Fixes for --method=scp +Monty - Working --noindex (copy only first 2048 bytes of index file). + Fixes for --method=scp. Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again. Emil S. Hansen - Added resetslave and resetmaster. -Jeremy D. Zawodny - Removed depricated DBI calls. Fixed bug which +Jeremy D. Zawodny - Removed deprecated DBI calls. Fixed bug which resulted in nothing being copied when a regexp was specified but no database name(s). Martin Waite - Fix to handle database name that contains space. -Paul DuBois - Remove end '/' from directory names +Paul DuBois - Remove end '/' from directory names. |