diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-09-11 20:43:48 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-09-11 20:43:48 +0200 |
commit | a3d80d952d7b99680ca4a3a89e128ecc0d490c10 (patch) | |
tree | 0d72ee69e037cdd09618ddb53652dd1b220890dc /scripts | |
parent | ec06ba24553d2d83b3a6a6bc4d8150910b01ee7c (diff) | |
parent | 966661c8cc75dd7d540a5fe40b4d893c40e91d26 (diff) | |
download | mariadb-git-a3d80d952d7b99680ca4a3a89e128ecc0d490c10.tar.gz |
merge with 5.1
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.am | 4 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 12 | ||||
-rwxr-xr-x | scripts/mysql_secure_installation.pl.in | 2 | ||||
-rw-r--r-- | scripts/mysql_secure_installation.sh | 39 | ||||
-rw-r--r-- | scripts/mysql_system_tables_fix.sql | 4 |
5 files changed, 32 insertions, 29 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am index be9354bd628..015b664c87d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -196,7 +196,3 @@ SUFFIXES = .sh $< > $@-t @CHMOD@ +x $@-t @MV@ $@-t $@ - - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 8bae2ec9db1..2d3775afb3a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -408,20 +408,16 @@ else echo " shell> $bindir/mysql -u root mysql" echo " mysql> show tables" echo - echo "Try 'mysqld --help' if you have problems with paths. Using --log" - echo "gives you a log in $ldata that may be helpful." + echo "Try 'mysqld --help' if you have problems with paths. Using" + echo "--general-log gives you a log in $ldata that may be helpful." echo - 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 at http://dev.mysql.com/doc/" + echo "The latest information about mysql_install_db is available at" + echo "http://kb.askmonty.org/v/installing-system-tables-mysql_install_db." 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 should use the $scriptdir/mysqlbug script!" - echo exit 1 fi diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 25339f9b916..0cd99267cdb 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -208,7 +208,7 @@ sub remove_anonymous_users { } sub remove_remote_root { - if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';")) { + if (do_query("DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');")) { print " ... Success!\n"; } else { print " ... Failed!\n"; diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh index 94472169c2a..fe93522aa87 100644 --- a/scripts/mysql_secure_installation.sh +++ b/scripts/mysql_secure_installation.sh @@ -68,7 +68,8 @@ parse_arguments() # release or installed source directory and return the path. find_in_basedir() { - return_dir= + return_dir=0 + found=0 case "$1" in --dir) return_dir=1; shift @@ -81,7 +82,8 @@ find_in_basedir() do if test -f "$basedir/$dir/$file" then - if test -n "$return_dir" + found=1 + if test $return_dir -eq 1 then echo "$basedir/$dir" else @@ -90,6 +92,17 @@ find_in_basedir() break fi done + + if test $found -eq 0 + then + # Test if command is in PATH + $file --no-defaults --version > /dev/null 2>&1 + status=$? + if test $status -eq 0 + then + echo $file + fi + fi } cannot_find_file() @@ -298,7 +311,7 @@ remove_anonymous_users() { } remove_remote_root() { - do_query "DELETE FROM mysql.user WHERE User='root' AND Host!='localhost';" + do_query "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" if [ $? -eq 0 ]; then echo " ... Success!" else @@ -355,14 +368,15 @@ cleanup() { # The actual script starts here prepare +find_mysql_client set_echo_compat echo -echo "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL" +echo "NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB" echo " SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!" 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 "In order to log into MariaDB to secure it, we'll need the current" +echo "password for the root user. If you've just installed MariaDB, and" echo "you haven't set the root password yet, the password will be blank," echo "so you should just press enter here." echo @@ -374,7 +388,7 @@ get_root_password # Set the root password # -echo "Setting the root password ensures that nobody can log into the MySQL" +echo "Setting the root password ensures that nobody can log into the MariaDB" echo "root user without the proper authorisation." echo @@ -403,8 +417,8 @@ echo # Remove anonymous users # -echo "By default, a MySQL installation has an anonymous user, allowing anyone" -echo "to log into MySQL without having to have a user account created for" +echo "By default, a MariaDB installation has an anonymous user, allowing anyone" +echo "to log into MariaDB without having to have a user account created for" echo "them. This is intended only for testing, and to make the installation" echo "go a bit smoother. You should remove them before moving into a" echo "production environment." @@ -443,7 +457,7 @@ echo # Remove test database # -echo "By default, MySQL comes with a database named 'test' that anyone can" +echo "By default, MariaDB comes with a database named 'test' that anyone can" echo "access. This is also intended only for testing, and should be removed" echo "before moving into a production environment." echo @@ -478,8 +492,7 @@ echo cleanup echo -echo "All done! If you've completed all of the above steps, your MySQL" +echo "All done! If you've completed all of the above steps, your MariaDB" echo "installation should now be secure." echo -echo "Thanks for using MySQL!" - +echo "Thanks for using MariaDB!" diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index 69fc1b8a052..44fadcc6e00 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -58,7 +58,7 @@ ALTER TABLE tables_priv COLLATE utf8_general_ci DEFAULT '' NOT NULL, MODIFY Table_priv set('Select','Insert','Update','Delete','Create', 'Drop','Grant','References','Index','Alter', - 'Create View','Show view') + 'Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, COMMENT='Table privileges'; @@ -584,8 +584,6 @@ ALTER TABLE host MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAU ALTER TABLE db ADD Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE db MODIFY Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; -ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL; - UPDATE user SET Trigger_priv=Super_priv WHERE @hadTriggerPriv = 0; ALTER TABLE user ADD plugin char(60) CHARACTER SET latin1 DEFAULT '' NOT NULL, ADD auth_string TEXT NOT NULL; |