File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ get_option () {
5
5
local section=$1
6
6
local option=$2
7
7
local default=$3
8
- ret=$( /usr/bin/my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2-)
8
+ ret=$( /usr/local/mysql/ bin/my_print_defaults $section | grep ' ^--' ${option} ' =' | cut -d= -f2-)
9
9
[ -z $ret ] && ret=$default
10
10
echo $ret
11
11
}
17
17
if [ " $1 " = ' mysqld' ]; then
18
18
# Get config
19
19
DATADIR=" $( " $@ " --verbose --help 2> /dev/null | awk ' $1 == "datadir" { print $2; exit }' ) "
20
- SOCKET=$( get_option mysqld socket " $datadir /mysql.sock" )
21
- PIDFILE=$( get_option mysqld pid-file " /var/run/mysqld/mysqld.pid" )
20
+ SOCKET=$( get_option mysqld socket " /tmp/mysql.sock" )
21
+ HOSTNAME=$( hostname)
22
+ PIDFILE=$( get_option mysqld pid-file " $DATADIR /$HOSTNAME .pid" )
22
23
23
24
if [ ! -d " $DATADIR /mysql" ]; then
24
25
if [ -z " $MYSQL_ROOT_PASSWORD " -a -z " $MYSQL_ALLOW_EMPTY_PASSWORD " ]; then
@@ -30,10 +31,10 @@ if [ "$1" = 'mysqld' ]; then
30
31
mkdir -p $DATADIR
31
32
fi
32
33
echo ' Running mysql_install_db'
33
- mysql_install_db --user=mysql --datadir=$DATADIR --rpm
34
+ mysql_install_db --user=mysql --datadir=$DATADIR --rpm --basedir=/usr/local/mysql
34
35
echo ' Finished mysql_install_db'
35
36
36
- mysqld --user=mysql --datadir=$DATADIR --skip-networking &
37
+ mysqld --user=mysql --datadir=$DATADIR --skip-networking --basedir=/usr/local/mysql &
37
38
for i in $( seq 30 -1 0) ; do
38
39
[ -S $SOCKET ] && break
39
40
echo ' MySQL init process in progress...'
You can’t perform that action at this time.
0 commit comments