• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

zweite MySQL Instanz

PROFI

Newbie
Moin Moin,

ich bin gerade dabei auf einer SLES 10 SP2 Maschine eine zweite Instanz von Mysql zu installieren,
was aber einige Probleme verursacht. Beide Instanzen starten mit rcmysql_instance1 erfolgreich.
Allerdings wird nur ein pid und eine socket Datei erstellt. Dementsprechend läuft nur eine Instanz.
Hat vielleicht jemand ein Tipp, was ich vergessen habe oder was ich beachten muss?

Mysql Server 5.0 wurde ganz normal über yast installiert.

Ich habe alles aus /var/lib/mysql in /var/lib/mysql/mysql_instance1/ verschoben
und zusätzlich in das zweite verzeichnis kopiert /var/lib/mysql/mysql_instance2/.
Die Rechte dementsprechend angepasst.
chown -R mysql:mysql /var/lib/mysql

Die my.cnf von /etc/my.cnf jeweils in /var/lib/mysql/mysql_instance1 und /var/lib/mysql/mysql_instance2 kopiert
und angepasst.
Hier mal der Auszug aus der my.cnf
Die Repliakationsangaben habe ich der besseren lesbarkeit rausgenommen.

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql_instance1/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql_instance1/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 100M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# The safe_mysqld script
[safe_mysqld]
err-log=/var/lib/mysql/mysql_instance1/mysqld.log

[mysqldump]
quick
max_allowed_packet = 100M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Die rot gekennzeichneten Angaben werden jeweils in der my.cnf für die zweite Instanz angepasst.

Als nächstes habe ich dann die Startskripte angepasst.
Das skript /etc/init.d/mysql nach /etc/init.d/mysql_instance1 verschoben und anschließend für die zweite Instanz kopiert und angepasst.


Hier ein Auszug aus dem Startskript.

#!/bin/sh
# Copyright (c) 1995-2002 SuSE Linux AG Nuernberg, Germany.
#
# Author: Lenz Grimmer <feedback@suse.de>
#
# /etc/init.d/mysql_instance1
#
# and its symbolic link
#
# /usr/sbin/rcmysql_instance1
#
### BEGIN INIT INFO
# Provides: mysql_instance1
# Required-Start: $network $remote_fs
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop:
# Description: Start the MySQL database server
### END INIT INFO

# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status

# First reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.

# Test, if mysqld or mysql-max actually exist
unset MYSQLD
if test -x /usr/sbin/mysqld-max
then
MYSQLD=/usr/sbin/mysqld-max
elif test -x /usr/sbin/mysqld
then
MYSQLD=/usr/sbin/mysqld
fi
test "$MYSQLD" || { echo "Nor /usr/sbin/mysqld nor /usr/sbin/mysqld-max exists"; rc_failed 5; rc_status -v; rc_exit; }

# The following section has been taken from
# the original MySQL init script
# Note: If you want to change these variables, you'll make your life easier
# if you do so in /etc/my.cnf, which is preserved during upgrades
basedir=/usr
datadir=/var/lib/mysql/mysql_instance1
mysql_daemon_user=mysql
mysql_daemon_group=mysql
pid_file=/var/lib/mysql/mysql_instance1/mysqld.pid
socket=/var/lib/mysql/mysql_instance1/mysql.sock
MYADMIN=/usr/bin/mysqladmin
if test -z "$basedir"
then
basedir=/usr
bindir=/usr/bin
else
bindir="$basedir/bin"
fi

if test -z "$pid_file"
then
pid_file=$datadir/`/bin/hostname`.pid
else
case "$pid_file" in
/* ) ;;
* ) pid_file="$datadir/$pid_file" ;;
esac
fi

mode=$1 # start or stop

parse_arguments() {
for arg do
case "$arg" in
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--socket=*) socket=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
done
}

# Don't run killproc -TERM, as it could send a SIGKILL as well, possibly
# resulting in database corruption. Run kill -TERM manually instead, wait
# approximately 60 seconds and fail if mysql doesn't respond. This will at
# least prevent the SIGKILL when doing 'rcmysql stop' manually. During system
# shutdown, we are out of luck...
# See https://bugzilla.novell.com/show_bug.cgi?id=223209
kill_mysql ()
{
local pid exe
test -e "$pid_file" || return 7 # not running
pid=`cat "$pid_file"` || return 4 # insufficient privileges
if ! test -e /proc/version; then
mount -n -t proc proc /proc
test -e /proc/version || return 100
fi
test -L "/proc/$pid/exe" || return 7
exe=`readlink "/proc/$pid/exe"` || return 4
test "$exe" = "$MYSQLD" || return 7
kill -STOP "$pid"
kill -TERM "$pid" || return 4 # suboptimal
kill -CONT "$pid"
for i in `seq 600`; do
# mysqld removes its pid file
test -e "$pid_file" || return 0
LC_ALL=C sleep 0.1
done
test -e "$pid_file" || return 0
return 1
}

# Get arguments from the my.cnf file, groups [mysqld] and [mysql_server]
if test -x ./bin/my_print_defaults
then
print_defaults="./bin/my_print_defaults"
elif test -x $bindir/my_print_defaults
then
print_defaults="$bindir/my_print_defaults"
elif test -x $bindir/mysql_print_defaults
then
print_defaults="$bindir/mysql_print_defaults"
else
# Try to find basedir in /etc/my.cnf
conf=/var/lib/mysql/mysql_instance1/my.cnf
print_defaults=
if test -r $conf
then
subpat='^[^=]*basedir[^=]*=\(.*\)$'
dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
for d in $dirs
do
d=`echo $d | sed -e 's/[ ]//g'`
if test -x "$d/bin/my_print_defaults"
then
print_defaults="$d/bin/my_print_defaults"
break
fi
if test -x "$d/bin/mysql_print_defaults"
then
print_defaults="$d/bin/mysql_print_defaults"
break
fi
done
fi

# Hope it's in the PATH ... but I doubt it
test -z "$print_defaults" && print_defaults="my_print_defaults"
fi

parse_arguments `$print_defaults $defaults mysqld mysql_server`
export TMPDIR=$datadir/.tmp
if ! test -d "$TMPDIR"; then
mkdir "$TMPDIR"
chown mysql:mysql "$TMPDIR"
chmod 755 "$TMPDIR"
fi

# Safeguard (relative paths, core dumps..)
cd $basedir

case "$1" in
start)
# exit gracefully, if we are already running
checkproc $MYSQLD && echo -n "Starting service MySQL " && \
rc_status -v && rc_exit

# Test, if safe_mysqld actually exists
SAFE_MYSQLD=/usr/bin/mysqld_safe
test -x $SAFE_MYSQLD || { echo "$SAFE_MYSQLD does not exist "; rc_failed 5; rc_status -v; rc_exit; }

# check for ISAM tables
tables=`find $datadir -name '*.ISM' | sed "s@$datadir/*@@; s@.ISM@@; s@/@.@;"`
if test -n "$tables" ; then
echo
echo "Some tables still use ISAM format, which is NO LONGER SUPPORTED"
echo "since mysql 5.0. To use these tables, you would need to open them"
echo "from an older mysql server and convert to something better (eg. MyISAM)."
echo
echo "Tables using ISAM are: "
echo " $tables "
echo
fi
# check for bdb tables
tables=`find $datadir -name '*.db' | sed "s@$datadir/*@@; s@.db@@; s@/@.@;"`
if test -n "$tables" ; then
echo
echo "Some tables still use BerkeleyDB format, please convert them to something "
echo "else. BerkeleyDB support will be dropped in future releases. "
echo "You can use mysql_convert_table_format script to do this conversion. "
echo
echo "Tables using BerkeleyDB are: "
echo " $tables "
echo
fi

# this file was used in past, but it's batter to place it youtside database directory
if test -f $datadir/mysql/stamp-4.1 ; then
rm $datadir/mysql/stamp-4.1
fi

# We assume a fresh install if the directory $datadir/mysql
# does not exist and create the privilege database
if ! ls $datadir/update-stamp-* >/dev/null 2>&1 ; then
echo "Creating/Updating MySQL privilege database... "
mysql_install_db --user=$mysql_daemon_user --datadir=$datadir || rc_failed
fi
if test ! -f $datadir/update-stamp-5.0 ; then
echo "Updating MySQL privilege database... "

echo "Fixing privilege tables... "
(echo 'USE mysql;'; cat /usr/share/mysql/mysql_fix_privilege_tables.sql) \
| sed '/^---\? /D; s/#.*//; s/;$/#/' | tr '\n' ' ' | tr '#' '\n' \
| /usr/sbin/mysqld \
--bootstrap \
--skip-innodb \
--skip-bdb \
--skip-grant-tables \
--user=$mysql_daemon_user \
--pid-file=$pid_file \
--socket=$socket \
--datadir=$datadir 2>/dev/null

rm -f $datadir/update-stamp-4.1
touch $datadir/update-stamp-5.0

# Fix ownerships and permissions for $datadir
chmod 755 $datadir
chown -R $mysql_daemon_user.$mysql_daemon_group $datadir
fi

echo -n "Starting service MySQL "

$SAFE_MYSQLD \
--user=$mysql_daemon_user \
--pid-file=$pid_file \
--socket=$socket \
--datadir=$datadir &>/dev/null &

for((i=0; i<50; i++)); do
sleep 0.2
test -S $socket && i='' && break
done

test -z "$i" || rc_failed

# Rmember status and be verbose
rc_status -v
;;

stop)
echo -n "Shutting down service MySQL "
kill_mysql

# Remember status and be verbose
rc_status -v
;;

try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart

# Remember status and be quiet
rc_status
;;

restart|force-reload)
echo "Restarting service MySQL "
$0 stop
$0 start

rc_status
;;

reload)
echo -n "Reloading service MySQL "
killproc -p $pid_file -HUP $MYSQLD
touch $pid_file
rc_status -v
;;

check|status)
echo -n "Checking for service MySQL: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.

# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running

# NOTE: checkproc returns LSB compliant status values.
checkproc $MYSQLD
rc_status -v
;;

*)
echo "Usage: $0 {start|stop|status|reload|restart|try-restart|force-reload}"
exit 1
;;
esac
rc_exit

# vim: ft=sh
 

panamajo

Guru
Die my.cnf von /etc/my.cnf jeweils in /var/lib/mysql/mysql_instance1 und /var/lib/mysql/mysql_instance2 kopiert
und angepasst.
Schön aber was soll das bringen? Der Pfad in dem MySQL die Konfiguration sucht muss entweder beim starten mitgegeben werden (und das machst du nicht) oder es wird der Default genommen.

http://dev.mysql.com/doc/refman/5.0/en/multiple-servers.html
 
OP
P

PROFI

Newbie
Moin Moin,

danke für die Antwort.
Du hast Recht ich habe die my.cnf und das startskript nochmal angepasst.
Jetzt startet aber mysql nicht und in der Fehlermeldung kommt folgende Ausgabe:
Starting service MySQL Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/HOSTNAME.LOCAL.pid
090611 04:13:04 mysqld ended

Hier der Auszug aus dem Startskript:
# Fix ownerships and permissions for $datadir
chmod 755 $datadir
chown -R $mysql_daemon_user.$mysql_daemon_group $datadir
fi

echo -n "Starting service MySQL "

$SAFE_MYSQLD \
--user=$mysql_daemon_user \
--defaults-file=/var/lib/mysql/mysql_instance1/my.cnf \
##--pid-file=$pid_file \
##--socket=$socket \
##--datadir=$datadir &>/dev/null &

for((i=0; i<50; i++)); do
sleep 0.2
test -S $socket && i='' && break
done

test -z "$i" || rc_failed


Und natürlich noch die my.cnf erweitert.
Hier der Auszug:


# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql_instance1/mysql.sock
pid-file =/var/lib/mysql/mysql_instance1/mysqla.pid


# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql_instance1/mysql.sock
pid-file =/var/lib/mysql/mysql_instance1/mysqla.pid
datadir =/var/lib/mysql/mysql_instance1

skip-locking
key_buffer = 16M
max_allowed_packet = 100M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

Warum startet der Mysql Server bzw. warum versucht der immernoch auf den Standardpfad zuzugreifen.
Für ein Tipp bedanke ich mich im Vorraus.

MFG
PROFI
 
OP
P

PROFI

Newbie
Moin Moin,

unterschiedliche Ports ist klar. Die Socket Dateien sollen ja in unterschiedlichen Verzeichnissen gespeichert werden
also sollte das auf kein Problem da sein.

Ich habe aber mittlerweile den MySQL Server zu starten bekommen, aber ich habe nachwievor
das gleliche Problem. Beim Startskript habe ich die defaults-file option direkt dahiner gesetzt.
Beide Instanzen starten mit wenn ich das init script ausführe.
Allerdings wird nur ein pid und eine socket Datei erstellt. Dementsprechend läuft nur eine Instanz.
Hat vielleicht jemand ein Tipp, was ich vergessen habe oder was ich beachten muss?
Dann habe ich festgestellt, dass trotzdem ein Verzeichniss /var/lib/mysql erstellt wird.

Hier ein Auszug wenn ich beide Instanzen über das init script starte.

HBSLES10:~ # ps -aux | grep mysql
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root 4159 0.0 0.2 9332 1740 pts/1 T 15:46 0:00 /bin/sh /etc/init.d/mysql_instance1 start
root 4183 0.0 0.1 8036 1488 pts/1 T 15:46 0:00 /bin/sh /usr/bin/mysqld_safe --defaults-file=/var/lib/mysql/mysql_instance1/my.cnf --user=mysql
mysql 4217 0.1 2.6 124624 20600 pts/1 Sl 15:46 0:00 /usr/sbin/mysqld --defaults-file=/var/lib/mysql/mysql_instance1/my.cnf --basedir=/usr --datadir=/var/lib/mysql/mysql_instance1 --user=mysql --pid-file=/var/lib/mysql/mysql_instance1/mysqla.pid --skip-external-locking --port=3306 --socket=/var/lib/mysql/mysql_instance1/mysqla.sock
root 4247 0.0 0.1 5008 824 pts/1

Heir nochmal der Auszug aus dem /etc/init.d/mysql_instance1 script

#!/bin/sh
# Copyright (c) 1995-2002 SuSE Linux AG Nuernberg, Germany.
#
# Author: Lenz Grimmer <feedback@suse.de>
#
# /etc/init.d/mysql_instance1
#
# and its symbolic link
#
# /usr/sbin/rcmysql_instance1
#
### BEGIN INIT INFO
# Provides: mysql_instance1

# Required-Start: $network $remote_fs
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop:
# Description: Start the MySQL database server
### END INIT INFO

# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
. /etc/rc.status

# First reset status of this service
rc_reset

# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.

# Test, if mysqld or mysql-max actually exist
unset MYSQLD
if test -x /usr/sbin/mysqld-max
then
MYSQLD=/usr/sbin/mysqld-max
elif test -x /usr/sbin/mysqld
then
MYSQLD=/usr/sbin/mysqld
fi
test "$MYSQLD" || { echo "Nor /usr/sbin/mysqld nor /usr/sbin/mysqld-max exists"; rc_failed 5; rc_status -v; rc_exit; }

# The following section has been taken from
# the original MySQL init script
# Note: If you want to change these variables, you'll make your life easier
# if you do so in /etc/my.cnf, which is preserved during upgrades
basedir=/usr
datadir=/var/lib/mysql
mysql_daemon_user=mysql
mysql_daemon_group=mysql
#pid_file=/var/lib/mysql/mysqld.pid
#socket=/var/lib/mysql/mysql.sock

MYADMIN=/usr/bin/mysqladmin
if test -z "$basedir"
then
basedir=/usr
bindir=/usr/bin
else
bindir="$basedir/bin"
fi

if test -z "$pid_file"
then
pid_file=$datadir/`/bin/hostname`.pid
else
case "$pid_file" in
/* ) ;;
* ) pid_file="$datadir/$pid_file" ;;
esac
fi

mode=$1 # start or stop

parse_arguments() {
for arg do
case "$arg" in
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--socket=*) socket=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
done
}

# Don't run killproc -TERM, as it could send a SIGKILL as well, possibly
# resulting in database corruption. Run kill -TERM manually instead, wait
# approximately 60 seconds and fail if mysql doesn't respond. This will at
# least prevent the SIGKILL when doing 'rcmysql stop' manually. During system
# shutdown, we are out of luck...
# See https://bugzilla.novell.com/show_bug.cgi?id=223209
kill_mysql ()
{
local pid exe
test -e "$pid_file" || return 7 # not running
pid=`cat "$pid_file"` || return 4 # insufficient privileges
if ! test -e /proc/version; then
mount -n -t proc proc /proc
test -e /proc/version || return 100
fi
test -L "/proc/$pid/exe" || return 7
exe=`readlink "/proc/$pid/exe"` || return 4
test "$exe" = "$MYSQLD" || return 7
kill -STOP "$pid"
kill -TERM "$pid" || return 4 # suboptimal
kill -CONT "$pid"
for i in `seq 600`; do
# mysqld removes its pid file
test -e "$pid_file" || return 0
LC_ALL=C sleep 0.1
done
test -e "$pid_file" || return 0
return 1
}

# Get arguments from the my.cnf file, groups [mysqld] and [mysql_server]
if test -x ./bin/my_print_defaults
then
print_defaults="./bin/my_print_defaults"
elif test -x $bindir/my_print_defaults
then
print_defaults="$bindir/my_print_defaults"
elif test -x $bindir/mysql_print_defaults
then
print_defaults="$bindir/mysql_print_defaults"
else
# Try to find basedir in /etc/my.cnf
conf=/etc/my.cnf
print_defaults=
if test -r $conf
then
subpat='^[^=]*basedir[^=]*=\(.*\)$'
dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf`
for d in $dirs
do
d=`echo $d | sed -e 's/[ ]//g'`
if test -x "$d/bin/my_print_defaults"
then
print_defaults="$d/bin/my_print_defaults"
break
fi
if test -x "$d/bin/mysql_print_defaults"
then
print_defaults="$d/bin/mysql_print_defaults"
break
fi
done
fi

# Hope it's in the PATH ... but I doubt it
test -z "$print_defaults" && print_defaults="my_print_defaults"
fi

parse_arguments `$print_defaults $defaults mysqld mysql_server`
export TMPDIR=$datadir/.tmp
if ! test -d "$TMPDIR"; then
mkdir "$TMPDIR"
chown mysql:mysql "$TMPDIR"
chmod 755 "$TMPDIR"
fi

# Safeguard (relative paths, core dumps..)
cd $basedir

case "$1" in
start)
# exit gracefully, if we are already running
checkproc $MYSQLD && echo -n "Starting service MySQL " && \
rc_status -v && rc_exit

# Test, if safe_mysqld actually exists
SAFE_MYSQLD=/usr/bin/mysqld_safe
test -x $SAFE_MYSQLD || { echo "$SAFE_MYSQLD does not exist "; rc_failed 5; rc_status -v; rc_exit; }

# check for ISAM tables
tables=`find $datadir -name '*.ISM' | sed "s@$datadir/*@@; s@.ISM@@; s@/@.@;"`
if test -n "$tables" ; then
echo
echo "Some tables still use ISAM format, which is NO LONGER SUPPORTED"
echo "since mysql 5.0. To use these tables, you would need to open them"
echo "from an older mysql server and convert to something better (eg. MyISAM)."
echo
echo "Tables using ISAM are: "
echo " $tables "
echo
fi
# check for bdb tables
tables=`find $datadir -name '*.db' | sed "s@$datadir/*@@; s@.db@@; s@/@.@;"`
if test -n "$tables" ; then
echo
echo "Some tables still use BerkeleyDB format, please convert them to something "
echo "else. BerkeleyDB support will be dropped in future releases. "
echo "You can use mysql_convert_table_format script to do this conversion. "
echo
echo "Tables using BerkeleyDB are: "
echo " $tables "
echo
fi

# this file was used in past, but it's batter to place it youtside database directory
if test -f $datadir/mysql/stamp-4.1 ; then
rm $datadir/mysql/stamp-4.1
fi

# We assume a fresh install if the directory $datadir/mysql
# does not exist and create the privilege database
if ! ls $datadir/update-stamp-* >/dev/null 2>&1 ; then
echo "Creating/Updating MySQL privilege database... "
mysql_install_db --user=$mysql_daemon_user --datadir=$datadir || rc_failed
fi
if test ! -f $datadir/update-stamp-5.0 ; then
echo "Updating MySQL privilege database... "

echo "Fixing privilege tables... "
(echo 'USE mysql;'; cat /usr/share/mysql/mysql_fix_privilege_tables.sql) \
| sed '/^---\? /D; s/#.*//; s/;$/#/' | tr '\n' ' ' | tr '#' '\n' \
| /usr/sbin/mysqld \
--bootstrap \
--skip-innodb \
--skip-bdb \
--skip-grant-tables \
--user=$mysql_daemon_user \
--pid-file=$pid_file \
--socket=$socket \
--datadir=$datadir 2>/dev/null

rm -f $datadir/update-stamp-4.1
touch $datadir/update-stamp-5.0

# Fix ownerships and permissions for $datadir
chmod 755 $datadir
chown -R $mysql_daemon_user.$mysql_daemon_group $datadir
fi

echo -n "Starting service MySQL "

$SAFE_MYSQLD --defaults-file=/var/lib/mysql/mysql_instance1/my.cnf \
--user=$mysql_daemon_user \
# --pid-file=$pid_file \
# --socket=$socket \
# --datadir=$datadir &>/dev/null &

for((i=0; i<50; i++)); do
sleep 0.2
test -S $socket && i='' && break
done

test -z "$i" || rc_failed

# Rmember status and be verbose
rc_status -v
;;

stop)
echo -n "Shutting down service MySQL "
kill_mysql

# Remember status and be verbose
rc_status -v
;;

try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
## Note: try-restart is not (yet) part of LSB (as of 0.7.5)
$0 status >/dev/null && $0 restart

# Remember status and be quiet
rc_status
;;

restart|force-reload)
echo "Restarting service MySQL "
$0 stop
$0 start

rc_status
;;

reload)
echo -n "Reloading service MySQL "
killproc -p $pid_file -HUP $MYSQLD
touch $pid_file
rc_status -v
;;

check|status)
echo -n "Checking for service MySQL: "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.

# Status has a slightly different for the status command:
# 0 - service running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running

# NOTE: checkproc returns LSB compliant status values.
checkproc $MYSQLD
rc_status -v
;;

*)
echo "Usage: $0 {start|stop|status|reload|restart|try-restart|force-reload}"
exit 1
;;
esac
rc_exit

# vim: ft=sh

Und hier nochmal der Auszug aus der /var/lib/mysql/instance1/my.cnf
Der Port wird natürlich auch angepasst.
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql_instance1/mysqla.sock
pid-file = /var/lib/mysql/mysql_instance1/mysqla.pid


# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql_instance1/mysqla.sock
pid-file = /var/lib/mysql/mysql_instance1/mysqla.pid
datadir = /var/lib/mysql/mysql_instance1

skip-locking
key_buffer = 16M
max_allowed_packet = 100M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M


# The safe_mysqld script
[safe_mysqld]
err-log=/var/lib/mysql/mysql_instance1/mysqld.log

[mysqldump]
quick
max_allowed_packet = 100M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Ich weiss nicht was ich falsch mache.
 
Oben