summaryrefslogtreecommitdiff
path: root/scripts/mysql_install_db.sh
diff options
context:
space:
mode:
authorlenz@mysql.com <>2003-09-10 17:48:43 +0200
committerlenz@mysql.com <>2003-09-10 17:48:43 +0200
commit541189e746bd89d56657438bd7c9d14910857c2b (patch)
treedc419df101ecab14d36829bb990da92549465f49 /scripts/mysql_install_db.sh
parent57290ee65f17cfac996e02203bbe03e3898f8a0d (diff)
downloadmariadb-git-541189e746bd89d56657438bd7c9d14910857c2b.tar.gz
- Added option "--skip-name-resolve" to mysql_install_db to be able to
use the local machine's IP address instead of the host name when building the initial grant tables if "skip-name-resolve" has been specified in my.cnf. This can be helpful on FreeBSD to avoid thread-safety problems with the FreeBSD resolver libraries. (Thanks to Jeremy Zawodny for the patch)
Diffstat (limited to 'scripts/mysql_install_db.sh')
-rw-r--r--scripts/mysql_install_db.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 920bd27cc88..0e685ba38e4 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -37,6 +37,7 @@ parse_arguments() {
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--ldata=*|--datadir=*) ldata=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--user=*) user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+ --skip-name-resolve) ip_only=1 ;;
*)
if test -n "$pick_args"
then
@@ -135,6 +136,12 @@ then
fi
fi
+if test "$ip_only" -eq 1
+then
+ ip=`echo "$resolved" | awk '/ /{print $6}'`
+ hostname=$ip
+fi
+
# Create database directories mysql & test
if test ! -d $ldata; then mkdir $ldata; chmod 700 $ldata ; fi
if test ! -d $ldata/mysql; then mkdir $ldata/mysql; chmod 700 $ldata/mysql ; fi