# [gelöst] mysql startet nicht korrekt

## bas89

Hallo,

[Die Lösung gibt es im letzten Post]

beim Booten steht dort „mysql NOT started!“ und wenn ich den dienst starten will passiert folgendes:

```
e

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 "/var/run/mysqld/mysqld.pid" is still present and the process is running.

 Please stop it "kill 3841" maybe ?                                                                                                                   [ !! ]

 * ERROR:  mysql failed to start

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 "/var/run/mysqld/mysqld.pid" is still present and the process is running.

 Please stop it "kill 3841" maybe ?                                                                                                                   [ !! ]

 * ERROR:  mysql failed to start

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 "/var/run/mysqld/mysqld.pid" is still present and the process is running.

 Please stop it "kill 3841" maybe ?                                                                                                                   [ !! ]

 * ERROR:  mysql failed to start

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 "/var/run/mysqld/mysqld.pid" is still present and the process is running.

 Please stop it "kill 3841" maybe ?                                                                                                                   [ !! ]

 * ERROR:  mysql failed to start

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 * Service mysql started

root@laptop /home/bas89 :) # 
```

Mal braucht es mehr Versuche, mal nur einen. Woran könnte das liegen? in /var/log/messages steht nur das, was auch auf der Konsole steht. In der /var/log/mysql/mysqld.err steht nur mehrmals

```

100716  9:48:48 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.

100716  9:48:48  InnoDB: Started; log sequence number 0 43655

100716  9:48:48 [Note] Event Scheduler: Loaded 0 events

100716  9:48:48 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.1.46-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Gentoo Linux mysql-5.1.46
```

Passieren tut das ganze  unabhängig davon, ob die 5.1er Variante oder die 5.0er installiert ist.

```

root@laptop /home/bas89 :) # eix mysql -I

[I] dev-db/mysql                                                                                                                     

     Installed versions:  5.1.46(22:54:38 09.07.2010)(community embedded perl ssl -big-tables -cluster -debug -extraengine -latin1 -max-idx-128 -minimal -pbxt -profiling -selinux -static -test -xtradb)
```

Es gibt sogar bugs (https://bugs.gentoo.org/show_bug.cgi?id=175783) dazu, aber ich konnte in keinem einen Workaround oder so lesen. Vielleicht geht es euch anders, das kann es doch nicht sein.

Habt ihr eine Idee, wie man das los wird?Last edited by bas89 on Sat Jul 17, 2010 10:28 am; edited 3 times in total

----------

## Schinkencroissant

Hallo,

eine echte Idee habe ich leider nicht, aber vielleicht die paar beruhigenden Worte, dass bei mir mysql auch ein paar mal nicht starten wollte und nach ein paar Versuchen, den Dienst von Hand zu starten, siehe da, es funktioniert wieder ohne Probleme.

Grüße,

Schinkencroissant

----------

## mokia

Hallo,

Ist /var/run/mysqld/ leer nach abschalten des demons?

Kanst Du mysqld Von terminal Fehlerlos starten und abschalten?

mysqld

killall -s 15 mysqld

Wie sihet dein startscript aus? cat /etc/initd/mysql?

MFG

----------

## bas89

Danke für die Ansätze. Hier das Ergebnis, lustigerweise reagiert mysqld nicht mehr, nachdem es gestartet wurde.

```

root@laptop linux :( # /etc/init.d/mysql stop

 * Service mysql stopping

 * Service mysql stopped

root@laptop linux :) # ls /var/run/mysqld 

root@laptop linux :) # mysqld            

^Zbg

^C^C^C^C^C^C^Z#                       (hier mach ich ein killall mysqld)

root@laptop linux :) # ls /var/run/mysqld &&cd
```

```

root@laptop ~ :) #mysqld --help

Default options are read from the following files in the given order:

/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf 

The following groups are read: mysqld server mysqld-5.1

[...........]

root@laptop ~ :) # cd /home/bas89 

root@laptop /home/bas89 :) # cat /etc/mysql/my.cnf >>mysqlcnf

```

Kann ich die mysql.cnf neu erstellen lassen, indem ich sie lösche? Gehen dann auch nicht meine Datenbanken verloren (Akonadi, Amarok)?

Mein Startscript:

```
root@laptop /home/bas89 :) # cat /etc/init.d/mysql

#!/sbin/runscript

# Copyright 1999-2006 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/dev-db/mysql-init-scripts/files/mysql.rc6,v 1.2 2007/03/04 15:47:03 vivo Exp $

# external binaries used: which, sed, tac

# int in_list(char * elem, char * list)

function in_list() {

        local elem=${1:-"none"}

        local list=${2:-","}

        [[ "${list}" == "${list/,${elem},/}" ]] \

        && return 1 \

        || return 0

}

function wdebug() {

        if [[ "${DEBUG}" -ge "${1}" ]] ; then

                shift

                echo "dbg:  ${@}"

        fi

}

depend() {

        use dns net localmount netmount nfsmount

}

do_escape() {

        # Ihatethisreallyverymuch

        #echo "$1" | sed -e "s|'| |" -e "s|=|='|" -e "s|$|'|"

        echo "$1"

}

# int get_slot_config(srv_slot=0, srv_num)

get_slot_config() {

        wdebug 4 ">>> get_slot_config()"

        local srv srv_slot srv_num

        srv_slot="${1:-"0"}"

        srv_num="${2}"

        MY_SUFFIX="-${srv_slot}"

        # srv=array(0 => [srv_slot], 1 => [srv_num] )

        srv=( ${srv_slot} ${srv_num} )

        local tmp_eval="mysql_slot_${srv_slot}${srv_num:+"_"}${srv_num}[@]"

        local conf_d_parameters="${!tmp_eval}"

        if [[ "${srv_slot}" == "0" ]] ; then

                MY_SUFFIX=''

                # try some other default for the default server

                [[ -z "${conf_d_parameters[@]}" ]] && conf_d_parameters=${mysql_slot[@]}

        fi

        [[ -z "${conf_d_parameters[@]}" ]] && conf_d_parameters=( )

        basedir="" datadir="" pidfile="" socket=""

        CHROOT="" NICE="" STARTUPTIMEOUT=5 STOPTIMEOUT=120

        wdebug 3 "srv                ${srv[@]}"

        wdebug 3 "srv_slot           ${srv_slot}"

        wdebug 3 "srv_num            ${srv_num}"

        wdebug 3 "tmp_eval           ${tmp_eval}"

        wdebug 3 "conf_d_parameters  ${conf_d_parameters[@]}"

        wdebug 3 "MY_SUFFIX          ${MY_SUFFIX}"

        local tmp_eval="mysql_slot_${srv_slot}${srv_num:+"_"}${srv_num}[@]"

        local conf_d_parameters="${!tmp_eval}"

        # collations need to be defined *after* the character sets,

        # so we will duplicate them

        local collations=""

        [[ ${conf_d_parameters[*]} == '()' ]] && conf_d_parameters=''

        MY_CNF="/etc/mysql${MY_SUFFIX}/my.cnf"

        # summa of unmanaged parameters

        # some parameters may be present multiple times

        unmanagedparams=""

        # grab the parameters from conf.d/mysql definition

        for my_default in ${conf_d_parameters[*]} ; do

                case "${my_default}" in

                        nice=*)

                                NICE="${my_default#nice=}"

                                nice -n $NICE ls /tmp &>/dev/null || NICE=""

                                ;;

                        mycnf=*) MY_CNF="${my_default#mycnf=}" ;;

                        startup_timeout=*)

                                STARTUPTIMEOUT="${my_default#startup_timeout=}" ;;

                        basedir=*) basedir="${my_default#basedir=}" ;;

                        datadir=*) datadir="${my_default#datadir=}" ;;

                        pid-file=*) pidfile="${my_default#pid-file=}" ;;

                        socket=*) socket="${my_default#socket=}" ;;

                        *collation*=)

                                collations="${collations} --$( do_escape "${my_default}" )"

                                ;;

                        *=*)

                                # list of parameters we already have

                                # prepend "--" because my_print_defaults do it

                                unmanagedparams="${unmanagedparams} --$( do_escape "${my_default}" )"

                                ;;

                        *)

                                unmanagedparams="${unmanagedparams} --${my_default}"

                                ;;

                esac

        done

        if [[ ! -r "${MY_CNF}" ]] ; then

                ewarn "Cannot access ${MY_CNF} !"

                MY_CNF=""

                my_defaults=""

        else

                local my_print_defaults="$(which my_print_defaults${MY_SUFFIX} 2>/dev/null)"

                if [[ ! -x "${my_print_defaults}" ]] ; then

                        eerror "my_print_defaults NOT found or not executable"

                        my_defaults=""

                else

                        my_defaults=$( ${my_print_defaults} \

                        --loose-verbose \

                        --config-file="${MY_CNF}" \

                        mysqld server )

                fi

        fi

        # grab needed parameters from my.cnf, don't override the ones from

        # conf.d/mysql

        for my_default in ${my_defaults} ; do

                case "${my_default}" in

                        --basedir=*)

                                [[ -z "${basedir}" ]] && basedir="${my_default#--basedir=}" ;;

                        --datadir=*)

                                [[ -z "${datadir}" ]] && datadir="${my_default#--datadir=}" ;;

                        --pid-file=*)

                                [[ -z "${pidfile}" ]] && pidfile="${my_default#--pid-file=}" ;;

                        --socket=*)

                                [[ -z "${socket}" ]] && socket="${my_default#--socket=}" ;;

                        --*collation*=)

                                # the order is inversed because we want the conf.d ones overriden

                                collations="$( do_escape "${my_default}" ) ${collations}"

                                ;;

                esac

        done

        # some parameters

        basedir="${basedir:-"/usr"}"

        datadir="${datadir:-"/var/lib/mysql${MY_SUFFIX}"}"

        pidfile="${pidfile:-"/var/run/mysqld/mysqld${MY_SUFFIX}.pid"}"

        socket="${socket:-"/var/run/mysqld/mysqld${MY_SUFFIX}.sock"}"

        unmanagedparams="${unmanagedparams} ${collations}"

        wdebug 3 "chroot dir => ${CHROOT}"

        wdebug 3 "niceness   => ${NICE}"

        wdebug 3 "basedir    => ${basedir}"

        wdebug 3 "datadir    => ${datadir}"

        wdebug 3 "pidfile    => ${pidfile}"

        wdebug 3 "socket     => ${socket}"

        wdebug 3 "Unamanged  => ${unmanagedparams}"

        # extension for sleep tenth of seconds, not very portable so check it before

        if sleep 0.01 ; then

                STARTUPTIMEOUT=$(( STARTUPTIMEOUT * 10 ))

                STOPTIMEOUT=$(( STOPTIMEOUT * 10 ))

                TIMEUNIT=0.1

        else

                TIMEUNIT=1

        fi

        # push these out to the script

        export MY_SUFFIX NICE MY_CNF pidfile datadir basedir socket CHROOT

        export unmanagedparams STARTUPTIMEOUT STOPTIMEOUT TIMEUNIT

        wdebug 4 "<<< get_slot_config() ok"

        return 0

}

checkconfig() {

        wdebug 4 ">>> checkconfig(\"${1}\")"

        local datadir="${1}" pidfile="${2}" socket="${3}"

        if [[ -n "${NOCHECK}" ]] ; then

                rm -f "${pidfile}" "${socket}"

                return 0

        fi

        if [[ ! -d "${datadir}" ]] ; then

                eerror "MySQL datadir is empty or invalid"

                eerror "Please check your my.cnf : ${MY_CNF}"

                wdebug 4 "<<< checkconfig() KO"

                return 1

        fi

        if [[ ! -d "${datadir}/mysql" ]] ; then

                eerror "You don't appear to have the mysql database installed yet."

                eerror "Please run /usr/bin/mysql_install_db to have this done..."

                wdebug 4 "<<< checkconfig() KO"

                return 1

        fi

        if [[ -f "${pidfile}" ]] ; then

                kill -15 $(< ${pidfile}) 2>/dev/null

                if [[ $? -eq 0 ]] ; then

                        # the process exist, we have a problem

                        eerror "\"${pidfile}\" is still present and the process is running."

                        eerror "Please stop it \"kill $(< ${pidfile})\" maybe ?"

                        wdebug 4 "<<< checkconfig() KO"

                        return 1

                else

                        rm -f "${pidfile}"

                fi

        fi

        if [[ -S "${socket}" ]] ; then

                ewarn "Strange, the socket file already exist in \"${socket}\""

                ewarn "it will be removed now and re-created by the MySQL server"

                ewarn "BUT please make your checks."

                rm -f "${socket}"

        fi

        wdebug 4 "<<< checkconfig() ok"

        return 0

}

start() {

        wdebug 4 ">>> start()"

        MYSQL_GLOB_PID_FILE=${MYSQL_GLOB_PID_FILE:-"/var/run/svc-started-${SVCNAME/mysql/mysqld}"}

        # servers are defined in /etc/conf.d/mysql

        local serverlist=${!mysql_slot_*}

        # provide default for empty conf.d/mysql

        if [[ -z "${serverlist}" ]] ; then

                serverlist=0

                export mysql_slot_0=( )

        fi

        local retstatus timeout

        local globretstatus=1

        local srv_slot srv_num

        # server MUST NOT share same location for these

        local pidfilelist=',' datadirlist=',' socketlist=','

        local ssd_thing=1

        local mysqld_thing tmpnice

        ebegin "Starting ${myservice}"

        # try to start each server

        for srv in ${serverlist[*]} ; do

                srv_slot="${srv#mysql_slot_}"

                if [[ "${srv_slot}" == "${srv_slot#*_}" ]] ; then

                        srv_num=''

                else

                        srv_num="${srv_slot#*_}"

                fi

                srv_slot="${srv_slot%%_*}"

                retstatus=0

                get_slot_config "${srv_slot}" "${srv_num}" || retstatus=1

                # checks

                if ! checkconfig "${datadir}" "${pidfile}" "${socket}" ; then

                        retstatus=2 ; continue

                fi

                if in_list "${pidfile}" "${pidfilelist}" ; then

                        eerror "Sorry, won't start with same pid-file: ${pidfile}"

                        retstatus=3 ; continue

                fi

                if in_list "${datadir}" "${datadirlist}" ; then

                        eerror "Sorry, won't start with same datadir: ${datadir}"

                        retstatus=4 ; continue

                fi

                if in_list "${socket}" "${socketlist}" ; then

                        eerror "Sorry, won't start with same socket: ${socket}"

                        retstatus=5 ; continue

                fi

                einfo "Starting ${myservice} (${MY_CNF})"

                mysqld_thing="${MY_CNF:+"--defaults-file="}${MY_CNF}"

                mysqld_thing="${mysqld_thing} ${unmanagedparams}"

                mysqld_thing="${mysqld_thing} --basedir=${basedir}"

                mysqld_thing="${mysqld_thing} --datadir=${datadir}"

                mysqld_thing="${mysqld_thing} --pid-file=${pidfile}"

                mysqld_thing="${mysqld_thing} --socket=${socket}"

                wdebug 2 "starting mysqld with: ${mysqld_thing}"

                if [[ ${ssd_thing} -eq 1 ]] ; then

                        tmpnice="${NICE:+"--nicelevel "}${NICE}"

                        start-stop-daemon --quiet ${DEBUG/*/"--verbose"} --start \

                        --background ${tmpnice} --pidfile ${pidfile} \

                        --exec ${basedir}/sbin/mysqld${MY_SUFFIX} -- ${mysqld_thing} \

                        && sleep ${TIMEUNIT}

                        retstatus=$?

                else

                        tmpnice="${NICE:+"nice -n "}${NICE}"

                        ${tmpnice} ${basedir}/sbin/mysqld${MY_SUFFIX} ${mysqld_thing} &

                        retstatus=0

                fi

                # only the first run is done by start-stop-daemon

                ssd_thing=""

                # wait for socket creation

                wdebug 1

                while ! [[ -S "${socket}" || "${STARTUPTIMEOUT}" -lt 1 || "${retstatus}" -ne 0 ]] ; do

                        STARTUPTIMEOUT=$(( STARTUPTIMEOUT - 1 ))

                        [[ ${DEBUG} -ge 1 ]] && echo -n "${STARTUPTIMEOUT},"

                        sleep ${TIMEUNIT}

                done

                wdebug 1 ""

                if [[ ! -S "${socket}" ]] ; then

                        eerror "MySQL${MY_SUFFIX} NOT started (${retstatus})"

                        retstatus=1

                else

                        globretstatus=0

                        pidfilelist="${pidfilelist}${pidfile},"

                        datadirlist="${datadirlist}${datadir},"

                        socketlist="${socketlist}${socket},"

                        echo "${srv_slot}${srv_num:+"_"}${srv_num}=${pidfile}" >> "${MYSQL_GLOB_PID_FILE}"

                fi

        done

        # successfull if at least one mysqld started

        wdebug 4 "<<< start()"

        eend $globretstatus

}

stop() {

        get_slot_config &> /dev/null

        MYSQL_GLOB_PID_FILE=${MYSQL_GLOB_PID_FILE:-"/var/run/svc-started-${SVCNAME/mysql/mysqld}"}

        local runwhat pidfile shutdown_elem

        local PID cnt timeout=${STOPTIMEOUT:-"120"}

        local retstatus=0

        local shutdown_list="$(< "${MYSQL_GLOB_PID_FILE}" )"

        ebegin "Stopping ${myservice}"

        wdebug 5 "MYSQL_GLOB_PID_FILE: ${MYSQL_GLOB_PID_FILE}"

        wdebug 5 "shutdown_list: ${shutdown_list}"

        for shutdown_elem in ${shutdown_list} ; do

                runwhat=${shutdown_elem%%=*}

                pidfile=${shutdown_elem#*=}

                timeout=${STOPTIMEOUT:-"120"}

                PID=$(< "${pidfile}" )

                wdebug 3 "runwhat            ${runwhat}"

                wdebug 3 "pidfile            ${pidfile}"

                wdebug 3 "timeout            ${timeout}"

                wdebug 3 "PID                ${PID}"

                einfo "Stopping mysqld (${runwhat})"

                start-stop-daemon --quiet ${DEBUG/*/"--verbose"} --stop --pidfile "${pidfile}" &

                wdebug 1 ""

                while [[ -n "$PID" ]] \

                        && $( ps -Ao pid | grep -q "^ *$PID$" ) \

                        && [[ "${timeout}" -ge 1 ]]

                do

                        timeout=$(($timeout - 1))

                        [[ ${DEBUG} -ge 1 ]] && echo -n "$(( $STOPTIMEOUT - $timeout )),"

                        sleep ${TIMEUNIT}

                done

                [[ "${timeout}" -lt 1 ]] && retstatus=1

        done

        sleep ${TIMEUNIT}

        [[ "$retstatus" -eq 0 ]] && rm -f "$MYSQL_GLOB_PID_FILE"

        eend ${retstatus}

}

```

----------

## mokia

"lustigerweise reagiert mysqld nicht mehr, nachdem es gestartet wurde. "

Ja weil es als terminalkommand ausgeführt wurde, und dicht als deamon lauft. (Also es ist normal)

"Gehen dann auch nicht meine Datenbanken verloren"

mysqldump -u root -p --all-datadases >mysqlbackup.sql 

Und du musst keine gedanken mehr darüber machen. XD

Hast du diese restart problem auch dann wenn die restart einmal gelungen ist, oder nur nach dem boot?

----------

## franzf

Ich hatte auch komische Probleme beim Startup (mysql war on, obwohl als failed angezeigt beim Boot).

Irgendwo hab ich in den Logs gefunden "Run mysql_upgrade [usw]", ich hab halt ein Update auf 5.1.46 hinter mir.

Evtl. tut dir das auch gut.

----------

## bas89

Ausschnitt aus /var/log/mysqld.err:

```

100710  9:49:04 [Note] /usr/sbin/mysqld: Normal shutdown

100710  9:49:06  InnoDB: Starting shutdown...

100710  9:49:10  InnoDB: Shutdown completed; log sequence number 0 43655

100710  9:49:10 [Note] /usr/sbin/mysqld: Shutdown complete

100710  9:49:11 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.

/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist

100710  9:49:11 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

100710  9:49:11  InnoDB: Started; log sequence number 0 43655

100710  9:49:11 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist

100710  9:49:11 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50090, now running 50146. Please use mysql_upgrade to fix this error.

100710  9:49:11 [ERROR] mysql.user has no `Event_priv` column at position 29

100710  9:49:11 [ERROR] Cannot open mysql.event

100710  9:49:11 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.

100710  9:49:11 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.1.46-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Gentoo Linux mysql-5.1.46
```

Daraufhin mach ich:

```

root@laptop build :( # mysql_upgrade -p

Enter password: 

Looking for 'mysql' as: mysql

Looking for 'mysqlcheck' as: mysqlcheck

This installation of MySQL is already upgraded to 5.1.46, use --force if you still need to run mysql_upgrade

```

Half also irgendwie nichts. Ich force mal:

```
e

root@laptop build :( # mysql_upgrade -p --force

Enter password: 

Looking for 'mysql' as: mysql

Looking for 'mysqlcheck' as: mysqlcheck

Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 

Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 

akonadi.CollectionAttributeTable                   OK

[...............]

mysql.columns_priv                                 OK

mysql.db                                           OK

mysql.event                                        OK

mysql.func                                         OK

mysql.general_log

Error    : You can't use locks with log tables.

status   : OK

mysql.help_category                                OK

mysql.help_keyword                                 OK

mysql.help_relation                                OK

mysql.help_topic                                   OK

mysql.host                                         OK

mysql.ndb_binlog_index                             OK

mysql.plugin                                       OK

mysql.proc                                         OK

mysql.procs_priv                                   OK

mysql.servers                                      OK

mysql.slow_log

Error    : You can't use locks with log tables.

status   : OK

mysql.tables_priv                                  OK

mysql.time_zone                                    OK

mysql.time_zone_leap_second                        OK

mysql.time_zone_name                               OK

mysql.time_zone_transition                         OK

mysql.time_zone_transition_type                    OK

mysql.user                                         OK

Running 'mysql_fix_privilege_tables'...

OK

```

Es ist bei mir auch der Fall, dass mysql teilweise funktioniert, während Amarok einwandfrei läuft, stört sich hingegen Akonadi. Nach einem Neustart steht beim Booten immernoch mysql NOT started, im Log steht

```

100717  0:28:15 [Note] /usr/sbin/mysqld: Normal shutdown

100717  0:28:15 [Note] Event Scheduler: Purging the queue. 0 events

100717  0:28:16  InnoDB: Starting shutdown...

100717  0:28:22  InnoDB: Shutdown completed; log sequence number 0 43655

100717  0:28:22 [Note] /usr/sbin/mysqld: Shutdown complete

100717  0:29:34  InnoDB: Started; log sequence number 0 43655

100717  0:29:35 [Note] Event Scheduler: Loaded 0 events

100717  0:29:35 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.1.46-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Gentoo Linux mysql-5.1.46

```

Und auf der Kommandozeile

```

root@laptop /home/bas89 :) # /etc/init.d/mysql restart                   

 * Service mysql starting

 "/var/run/mysqld/mysqld.pid" is still present and the process is running.

 Please stop it "kill 3818" maybe ?                                                                                                                   [ !! ]

 * ERROR:  mysql failed to start

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 * Service mysql started

```

Und das Neue in der mysql.err ist

```

100717  0:35:17 [Note] Event Scheduler: Purging the queue. 0 events

100717  0:35:17  InnoDB: Starting shutdown...

100717  0:35:20  InnoDB: Shutdown completed; log sequence number 0 43655

100717  0:35:20 [Note] /usr/sbin/mysqld: Shutdown complete

100717  0:35:21  InnoDB: Started; log sequence number 0 43655

100717  0:35:21 [Note] Event Scheduler: Loaded 0 events

100717  0:35:21 [Note] /usr/sbin/mysqld: ready for connections.

Version: '5.1.46-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Gentoo Linux mysql-5.1.46

```

----------

## bas89

Ich habe nun mysql mit -embedded und -community neu bauen lassen (brauch ich beides nicht), die Scripts mit 

emerge mysql-init-scripts

neu gebaut... Es half alles nichts: „mysql NOT started“ und

```

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 "/var/run/mysqld/mysqld.pid" is still present and the process is running.

 Please stop it "kill 3826" maybe ?                                                                                                                   [ !! ]

 * ERROR:  mysql failed to start

root@laptop /home/bas89 :( # /etc/init.d/mysql restart

 * Service mysql starting

 * Service mysql started

```

In den Logs sieht alles top aus.

 *mokia wrote:*   

> 
> 
> Hast du diese restart problem auch dann wenn die restart einmal gelungen ist, oder nur nach dem boot?

  Das Problem gibts nur einmal pro boot. Mir kam es später nicht mehr vor.

Der Fehler tritt nicht mehr auf, wenn man in der /etc/conf.d/rc das parallele Starten von Diensten deaktiviert.

----------

## mokia

"Der Fehler tritt nicht mehr auf, wenn man in der /etc/conf.d/rc  das parallele Starten von Diensten deaktiviert."

Vielleicht ist das ein einfaches timeout problem.

Versuch mal STARTUPTIMEOUT auf 20 einzustellen In /etc/init.d/mysql

----------

## bas89

Das löst auch das Problem:

```

root@laptop /home/bas89 :) # /etc/init.d/mysql restart

 * Service mysql stopping

 * Stopping mysql ...

 * Stopping mysqld (0)                                                                                                                                [ ok ]

 * Service mysql stopped

 * Service mysql starting

 * Starting mysql ...

 * Starting mysql (/etc/mysql/my.cnf)                                                                                                                 [ ok ]

 * Service mysql started

```

Danke für eure Hilfe!

----------

## mokia

Ich glaube das man diesen wert correcte weise in /etc/donf.d/mysql einstellen kann. (Nur damit es nicht direct in initskript sthet.)

----------

