diff options
author | unknown <df@pippilotta.erinye.com> | 2007-12-10 12:16:41 +0100 |
---|---|---|
committer | unknown <df@pippilotta.erinye.com> | 2007-12-10 12:16:41 +0100 |
commit | aab0f89168fb45107cfcf93974d4e291c729c3bc (patch) | |
tree | 076fd59c0509c986b983131b1f5a4b757a5c2b16 /scripts | |
parent | 3d0696412d2782dd3caf70bbcf33cea8303fe6da (diff) | |
parent | dddeed8b0fa871f6aa8dca15db8e849ec955a3ed (diff) | |
download | mariadb-git-aab0f89168fb45107cfcf93974d4e291c729c3bc.tar.gz |
Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
Makefile.am:
Auto merged
configure.in:
null merge version change
scripts/mysql_install_db.sh:
manual merge
scripts/mysql_system_tables_data.sql:
manual merge
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_install_db.sh | 36 | ||||
-rw-r--r-- | scripts/mysql_system_tables_data.sql | 12 |
2 files changed, 26 insertions, 22 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b1d5ad7a0d0..cc9c64e8f07 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -31,7 +31,7 @@ user="" force=0 in_rpm=0 ip_only=0 -windows=0 +cross_bootstrap=0 usage() { @@ -41,6 +41,8 @@ Usage: $0 [OPTIONS] --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 + tables on a different host than the target. --datadir=path The path to the MySQL data directory. --force Causes mysql_install_db to run even if DNS does not work. In that case, grant table entries that normally @@ -60,8 +62,6 @@ Usage: $0 [OPTIONS] user. You must be root to use this option. By default mysqld runs using your current login name and files and directories that it creates will be owned by you. - --windows For internal use. This option is used for creating - Windows distributions. All other options are passed to the mysqld program @@ -71,7 +71,7 @@ EOF s_echo() { - if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + if test "$in_rpm" -eq 0 -a "$cross_bootstrap" -eq 0 then echo "$1" fi @@ -114,16 +114,17 @@ parse_arguments() --no-defaults|--defaults-file=*|--defaults-extra-file=*) defaults="$arg" ;; - --windows) - # This is actually a "cross bootstrap" argument used when - # building the MySQL 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, the most common use for - # this feature is in the windows installer which will take - # the files from datadir and include them as part of the install - # package. - windows=1 ;; + --cross-bootstrap|--windows) + # Used when building the MySQL 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. + # + # The most common use for this feature is in the Windows installer + # which will take the files from datadir and include them as part of + # the install package. See top-level 'dist-hook' make target. + # + # --windows is a deprecated alias + cross_bootstrap=1 ;; *) if test -n "$pick_args" @@ -274,7 +275,7 @@ fi hostname=`@HOSTNAME@` # Check if hostname is valid -if test "$windows" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 +if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0 then resolved=`$extra_bindir/resolveip $hostname 2>&1` if test $? -ne 0 @@ -332,7 +333,7 @@ mysqld_install_cmd_line="$mysqld_bootstrap $defaults $mysqld_opt --bootstrap \ # Create the system and help tables by passing them to "mysqld --bootstrap" s_echo "Installing MySQL system tables..." -if `(echo "use mysql;"; cat $create_system_tables $fill_system_tables) | $mysqld_install_cmd_line` +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" else @@ -382,7 +383,6 @@ then s_echo s_echo "To start mysqld at boot time you have to copy" 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 "To do so, start the server, then issue the following commands:" @@ -401,10 +401,8 @@ then if test "$in_rpm" -eq 0 then - echo echo "You can start the MySQL daemon with:" echo "cd $basedir ; $bindir/mysqld_safe &" - echo echo "You can test the MySQL daemon with mysql-test-run.pl" echo "cd $basedir/mysql-test ; perl mysql-test-run.pl" fi diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 89558f99603..6db9430b972 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -2,6 +2,12 @@ -- The inital data for system tables of MySQL Server -- +-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix +-- host which will later be included in a Windows zip file), any lines +-- containing "@current_hostname" are filtered out by mysql_install_db. +set @current_hostname= @@hostname; + + -- Fill "db" table with default grants for anyone to -- access database 'test' and 'test_%' if "db" table didn't exist CREATE TEMPORARY TABLE tmp_db LIKE db; @@ -14,11 +20,11 @@ DROP TABLE tmp_db; -- Fill "users" table with default users allowing root access -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; -set @hostname= @@hostname; +set @current_hostname= @@hostname; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +REPLACE INTO tmp_user VALUES (@current_hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) VALUES (@@hostname,''); +INSERT INTO tmp_user (host,user) VALUES (@current_hostname,''); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user; |