install_test_db
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· 代码 · 共 117 行
TXT
117 行
#!/bin/sh# Copyright (C) 1997-2006 MySQL 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# 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# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# # You should have received a copy of the GNU General Public License# 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 privilege tables db, host, user, tables_priv,# columns_priv in the mysql database, as well as the func table.if [ x$1 = x"--bin" ]; then shift 1 BINARY_DIST=1 bindir=../bin scriptdir=bin libexecdir=../libexec # Check if it's a binary distribution or a 'make install' if test -x ../libexec/mysqld then execdir=../libexec elif test -x ../../sbin/mysqld # RPM installation then execdir=../../sbin bindir=../../bin scriptdir=../bin libexecdir=../../libexec else execdir=../bin fi fix_bin=mysql-testelse execdir=../sql bindir=../client fix_bin=. scriptdir=scripts libexecdir=../libexecfivardir=varlogdir=$vardir/logif [ x$1 = x"-slave" ] then shift 1 data=var/slave-data ldata=$fix_bin/var/slave-dataelse if [ x$1 = x"-1" ] then data=var/master-data1 else data=var/master-data fi ldata=$fix_bin/$datafimdata=$data/mysqlEXTRA_ARG=""mysqld=if test -x $execdir/mysqldthen mysqld=$execdir/mysqldelse if test ! -x $libexecdir/mysqld then echo "mysqld is missing - looked in $execdir and in $libexecdir" exit 1 else mysqld=$libexecdir/mysqld fifi# On IRIX hostname is in /usr/bsd so add this to the pathPATH=$PATH:/usr/bsdhostname=`hostname` # Install this too in the user tablehostname="$hostname%" # Fix if not fully qualified hostname#create the directories[ -d $vardir ] || mkdir $vardir[ -d $logdir ] || mkdir $logdir# Create database directories mysql & testif [ -d $data ] ; then rm -rf $data ; fimkdir $data $data/mysql $data/test #for error messagesif [ x$BINARY_DIST = x1 ] ; thenbasedir=..elsebasedir=.EXTRA_ARG="--windows"fiINSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=."echo "running $INSTALL_CMD"cd ..if $INSTALL_CMDthen exit 0else echo "Error executing mysqld --bootstrap" exit 1fi
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?