summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am4
-rw-r--r--scripts/fill_help_tables.sh3
-rw-r--r--scripts/make_binary_distribution.sh1
-rw-r--r--scripts/mysql_config.sh3
-rw-r--r--scripts/mysql_fix_privilege_tables.sh18
-rw-r--r--scripts/mysql_fix_privilege_tables.sql172
-rw-r--r--scripts/mysql_install_db.sh36
-rw-r--r--scripts/mysql_secure_installation.sh3
-rw-r--r--scripts/mysqlaccess.sh6
-rw-r--r--scripts/mysqld_multi.sh6
10 files changed, 158 insertions, 94 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index dd4c133ff94..585c8ca8655 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -2,8 +2,7 @@
#
# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -115,6 +114,7 @@ SUFFIXES = .sh
-e 's!@''pkglibdir''@!$(pkglibdir)!g' \
-e 's!@''pkgincludedir''@!$(pkgincludedir)!g' \
-e 's!@''pkgdatadir''@!$(pkgdatadir)!g' \
+ -e 's!@''sysconfdir''@!$(sysconfdir)!g' \
-e 's!@''CC''@!@CC@!'\
-e 's!@''CXX''@!@CXX@!'\
-e 's!@''GXX''@!@GXX@!'\
diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh
index fc0c684c2dc..1a9f63e36d9 100644
--- a/scripts/fill_help_tables.sh
+++ b/scripts/fill_help_tables.sh
@@ -498,8 +498,7 @@ print <<EOF;
--
-- 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
--- the Free Software Foundation; either version 2 of the License, or
--- (at your option) any later version.
+-- the Free Software Foundation; version 2 of the License.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index a6a2f1e3b49..9469cca875d 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -243,6 +243,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include
$CP mysql-test/include/*.test $BASE/mysql-test/include
$CP mysql-test/t/*.def $BASE/mysql-test/t
$CP mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
+ mysql-test/std_data/*.MYD mysql-test/std_data/*.MYI \
mysql-test/std_data/*.pem mysql-test/std_data/Moscow_leap \
mysql-test/std_data/des_key_file mysql-test/std_data/*.*001 \
mysql-test/std_data/*.cnf \
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 92201a2c8af..b47e7740c75 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -3,8 +3,7 @@
#
# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index 073964d4bde..910992191f3 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -119,9 +119,6 @@ then
fi
cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host"
-if test ! -z "$password" ; then
- cmd="$cmd --password=$password"
-fi
if test ! -z "$port"; then
cmd="$cmd --port=$port"
fi
@@ -178,11 +175,22 @@ then
s_echo ""
fi
+run_cmd() {
+ # Password argument is added here to allow for spaces in password.
+
+ if test ! -z "$password"
+ then
+ cat $sql_file | $cmd --password="$password"
+ else
+ cat $sql_file | $cmd
+ fi
+}
+
if test $verbose = 0
then
- cat $sql_file | $cmd > /dev/null 2>&1
+ run_cmd > /dev/null 2>&1
else
- cat $sql_file | $cmd > /dev/null
+ run_cmd > /dev/null
fi
if test $? = 0
then
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index 41d468fd3cf..5709fb96793 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -1,5 +1,5 @@
-- This script converts any old privilege tables to privilege tables suitable
--- for MySQL 4.0.
+-- for MySQL 4.1
-- You can safely ignore all 'Duplicate column' and 'Unknown column' errors"
-- because these just mean that your tables are already up to date.
@@ -46,9 +46,8 @@ ADD x509_subject BLOB NOT NULL;
ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
--
--- Create tables_priv and columns_priv if they don't exists
+-- tables_priv
--
-
CREATE TABLE IF NOT EXISTS tables_priv (
Host char(60) binary DEFAULT '' NOT NULL,
Db char(64) binary DEFAULT '' NOT NULL,
@@ -56,22 +55,38 @@ CREATE TABLE IF NOT EXISTS tables_priv (
Table_name char(64) binary DEFAULT '' NOT NULL,
Grantor char(77) DEFAULT '' NOT NULL,
Timestamp timestamp(14),
- Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
+ Table_priv set('Select','Insert','Update','Delete','Create',
+ 'Drop','Grant','References','Index','Alter')
+ COLLATE utf8_general_ci DEFAULT '' NOT NULL,
+ Column_priv set('Select','Insert','Update','References')
+ COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name)
) CHARACTER SET utf8 COLLATE utf8_bin;
--- Fix collation of set fields
+
ALTER TABLE tables_priv
- modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-ALTER TABLE procs_priv ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE procs_priv
- modify Proc_priv set('Execute','Alter Routine','Grant') 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;
-ALTER TABLE procs_priv
- modify Timestamp timestamp(14) AFTER Proc_priv;
+ ADD KEY Grantor (Grantor);
+ALTER TABLE tables_priv
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY Db char(64) NOT NULL default '',
+ MODIFY User char(16) NOT NULL default '',
+ MODIFY Table_name char(64) NOT NULL default '',
+ MODIFY Grantor char(77) NOT NULL default '',
+ ENGINE=MyISAM,
+ CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+
+ALTER TABLE tables_priv
+ MODIFY Column_priv set('Select','Insert','Update','References')
+ 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')
+ COLLATE utf8_general_ci DEFAULT '' NOT NULL,
+ COMMENT='Table privileges';
+
+--
+-- columns_priv
+--
CREATE TABLE IF NOT EXISTS columns_priv (
Host char(60) DEFAULT '' NOT NULL,
Db char(64) DEFAULT '' NOT NULL,
@@ -82,16 +97,25 @@ CREATE TABLE IF NOT EXISTS columns_priv (
Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
PRIMARY KEY (Host,Db,User,Table_name,Column_name)
) CHARACTER SET utf8 COLLATE utf8_bin;
--- Fix collation of set fields
-ALTER TABLE columns_priv
- MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-
---
-- Name change of Type -> Column_priv from MySQL 3.22.12
---
+ALTER TABLE columns_priv
+ CHANGE Type Column_priv set('Select','Insert','Update','References')
+ COLLATE utf8_general_ci DEFAULT '' NOT NULL;
+
+ALTER TABLE columns_priv
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY Db char(64) NOT NULL default '',
+ MODIFY User char(16) NOT NULL default '',
+ MODIFY Table_name char(64) NOT NULL default '',
+ MODIFY Column_name char(64) NOT NULL default '',
+ ENGINE=MyISAM,
+ CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin,
+ COMMENT='Column privileges';
-ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
+ALTER TABLE columns_priv
+ MODIFY Column_priv set('Select','Insert','Update','References')
+ COLLATE utf8_general_ci DEFAULT '' NOT NULL;
--
-- Add the new 'type' column to the func table.
@@ -100,7 +124,7 @@ ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update',
ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
--
--- Change the user,db and host tables to MySQL 4.0 format
+-- Change the user,db and host tables to current format
--
# Detect whether we had Show_db_priv
@@ -142,14 +166,12 @@ ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT
ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL;
-alter table tables_priv add KEY Grantor (Grantor);
+
alter table db comment='Database privileges';
alter table host comment='Host privileges; Merged with database privileges';
alter table user comment='Users and global privileges';
alter table func comment='User defined functions';
-alter table tables_priv comment='Table privileges';
-alter table columns_priv comment='Column privileges';
-- Convert all tables to UTF-8 with binary collation
-- and reset all char columns to correct width
@@ -181,6 +203,7 @@ ALTER TABLE user
MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
+
ALTER TABLE db
MODIFY Host char(60) NOT NULL default '',
MODIFY Db char(64) NOT NULL default '',
@@ -199,6 +222,7 @@ ALTER TABLE db
MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
+
ALTER TABLE host
MODIFY Host char(60) NOT NULL default '',
MODIFY Db char(64) NOT NULL default '',
@@ -216,29 +240,11 @@ ALTER TABLE host
MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL;
+
ALTER TABLE func
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE func
MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
-ALTER TABLE columns_priv
- MODIFY Host char(60) NOT NULL default '',
- MODIFY Db char(64) NOT NULL default '',
- MODIFY User char(16) NOT NULL default '',
- MODIFY Table_name char(64) NOT NULL default '',
- MODIFY Column_name char(64) NOT NULL default '',
- ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE columns_priv
- MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
-ALTER TABLE tables_priv
- MODIFY Host char(60) NOT NULL default '',
- MODIFY Db char(64) NOT NULL default '',
- MODIFY User char(16) NOT NULL default '',
- MODIFY Table_name char(64) NOT NULL default '',
- MODIFY Grantor char(77) NOT NULL default '',
- ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE tables_priv
- MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
- MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
#
# Detect whether we had Create_view_priv
@@ -250,20 +256,25 @@ SELECT @hadCreateViewPriv:=1 FROM user WHERE Create_view_priv LIKE '%';
# Create VIEWs privileges (v5.0)
#
ALTER TABLE db ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv;
+ALTER TABLE db MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv;
+
ALTER TABLE host ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv;
+ALTER TABLE host MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv;
+
ALTER TABLE user ADD Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv;
+ALTER TABLE user MODIFY Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_client_priv;
#
# Show VIEWs privileges (v5.0)
#
ALTER TABLE db ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
+ALTER TABLE db MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
+
ALTER TABLE host ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
-ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
+ALTER TABLE host MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
-#
-# Show/Create views table privileges (v5.0)
-#
-ALTER TABLE tables_priv MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
+ALTER TABLE user ADD Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
+ALTER TABLE user MODIFY Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_view_priv;
#
# Assign create/show view privileges to people who have create provileges
@@ -280,18 +291,31 @@ SELECT @hadCreateRoutinePriv:=1 FROM user WHERE Create_routine_priv LIKE '%';
# Create PROCEDUREs privileges (v5.0)
#
ALTER TABLE db ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
+ALTER TABLE db MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
+
ALTER TABLE host ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
+ALTER TABLE host MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
+
ALTER TABLE user ADD Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
+ALTER TABLE user MODIFY Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_view_priv;
#
# Alter PROCEDUREs privileges (v5.0)
#
ALTER TABLE db ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
+ALTER TABLE db MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
+
ALTER TABLE host ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
+ALTER TABLE host MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
+
ALTER TABLE user ADD Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
+ALTER TABLE user MODIFY Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_routine_priv;
ALTER TABLE db ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
+ALTER TABLE db MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
+
ALTER TABLE host ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
+ALTER TABLE host MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
#
# Assign create/alter routine privileges to people who have create privileges
@@ -313,26 +337,46 @@ SET @hadCreateUserPriv:=0;
SELECT @hadCreateUserPriv:=1 FROM user WHERE Create_user_priv LIKE '%';
ALTER TABLE user ADD Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
+ALTER TABLE user MODIFY Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_routine_priv;
UPDATE user LEFT JOIN db USING (Host,User) SET Create_user_priv='Y'
WHERE @hadCreateUserPriv = 0 AND
(user.Grant_priv = 'Y' OR db.Grant_priv = 'Y');
-#
-# Create some possible missing tables
-#
+--
+-- procs_priv
+--
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)
+ 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)
) CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';
+ALTER TABLE procs_priv
+ ENGINE=MyISAM,
+ CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+
+ALTER TABLE procs_priv
+ MODIFY Proc_priv set('Execute','Alter Routine','Grant')
+ 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;
+
+ALTER TABLE procs_priv
+ MODIFY Timestamp timestamp(14) AFTER Proc_priv;
+
+--
+-- help_topic
+--
CREATE TABLE IF NOT EXISTS help_topic (
help_topic_id int unsigned not null,
name varchar(64) not null,
@@ -408,7 +452,7 @@ PRIMARY KEY TranTime (Transition_time)
#
-# Create proc table if it doesn't exists
+# Create proc table if it does not exists
#
CREATE TABLE IF NOT EXISTS proc (
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 5d7933e5277..e43b586054e 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -33,6 +33,7 @@ parse_arguments() {
case "$arg" in
--force) force=1 ;;
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --srcdir=*) srcdir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--user=*)
# Note that the user will be passed to mysqld so that it runs
@@ -78,6 +79,7 @@ ldata=
execdir=
bindir=
basedir=
+srcdir=
force=0
verbose=0
fill_help_tables=""
@@ -106,18 +108,24 @@ else
fi
# find fill_help_tables.sh
-for i in $basedir/support-files $basedir/share $basedir/share/mysql $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
-do
- if test -f $i/fill_help_tables.sql
- then
- pkgdatadir=$i
- fi
-done
-
-if test -f $pkgdatadir/fill_help_tables.sql
+if test -n "$srcdir"
then
- fill_help_tables=$pkgdatadir/fill_help_tables.sql
+ fill_help_tables=$srcdir/scripts/fill_help_tables.sql
else
+ for i in $basedir/support-files $basedir/share $basedir/share/mysql \
+ $basedir/scripts `pwd` `pwd`/scripts @pkgdatadir@
+ do
+ if test -f $i/fill_help_tables.sql
+ then
+ pkgdatadir=$i
+ fi
+ done
+
+ fill_help_tables=$pkgdatadir/fill_help_tables.sql
+fi
+
+if test ! -f $fill_help_tables
+then
echo "Could not find help file 'fill_help_tables.sql' in @pkgdatadir@ or inside $basedir".
exit 1;
fi
@@ -130,7 +138,13 @@ scriptdir=$bindir
if test "$windows" = 1
then
mysqld="./sql/mysqld"
- mysqld_opt="--language=./sql/share/english"
+ if test -n "$srcdir" -a -f $srcdir/sql/share/english/errmsg.sys
+ then
+ langdir=$srcdir/sql/share/english
+ else
+ langdir=./sql/share/english
+ fi
+ mysqld_opt="--language=$langdir"
scriptdir="./scripts"
fi
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index 1c7ca34ad59..f437a3d8bfc 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -4,8 +4,7 @@
#
# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
+# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 654b43a8a99..22e9d121f9a 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -462,8 +462,8 @@ MySQLaccess::Report::Print_Header();
if (-f "./$script_conf") {
require "./$script_conf";
}
- elsif (-f "/etc/$script_conf") {
- require "/etc/$script_conf";
+ elsif (-f "@sysconfdir@/$script_conf") {
+ require "@sysconfdir@/$script_conf";
}
# ****************************
@@ -929,7 +929,7 @@ sub MergeConfigFile {
# =================================
sub MergeConfigFiles {
my ($name,$pass,$uid,$gid,$quota,$comment,$gcos,$dir,$shell) = getpwuid $<;
- MergeConfigFile("/etc/my.cnf");
+ MergeConfigFile("@sysconfdir@/my.cnf");
MergeConfigFile("$dir/.my.cnf");
}
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 2dcc8dc7bc4..12758ae8290 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -464,9 +464,9 @@ sub find_groups
}
else
{
- if (-f "/etc/my.cnf" && -r "/etc/my.cnf")
+ if (-f "@sysconfdir@/my.cnf" && -r "@sysconfdir@/my.cnf")
{
- open(MY_CNF, "</etc/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
+ open(MY_CNF, "<@sysconfdir@/my.cnf") && (@tmp=<MY_CNF>) && close(MY_CNF);
}
for ($i = 0; ($line = shift @tmp); $i++)
{
@@ -703,7 +703,7 @@ sub example
# (as per Linux/Unix standard). You may even replace the
# /etc/init.d/mysql.server script with it.
#
-# Before using, you must create a my.cnf file either in /etc/my.cnf
+# Before using, you must create a my.cnf file either in @sysconfdir@/my.cnf
# or /root/.my.cnf and add the [mysqld_multi] and [mysqld#] groups.
#
# The script can be found from support-files/mysqld_multi.server.sh