MySQL startup confused [SOLVED]

Sasa Stupar sasa at stupar.homelinux.net
Wed Jan 12 17:18:51 UTC 2005



--On 12. januar 2005 9:44 +0100 "Lars E. Pettersson" <lars at homer.se> wrote:

> On Tue, 2005-01-11 at 21:10, Alexander Dalloz wrote:
>> That was Jason's quick guess. And having a look at the mysql init script
>> you will find following comment:
>>
>>         # If you've removed anonymous users, this line must be changed
>> to
>>         # use a user that is allowed to ping mysqld.
>>         ping="/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping"
>
> The update from January 5 does it in an even better way (see the
> bugzilla mentioned earlier in th thread)
>
>         # Spin for a maximum of N seconds waiting for the server to come
> up.
>         # Rather than assuming we know a valid username, accept an
> "access
>         # denied" response as meaning the server is functioning.
>         if [ $ret -eq 0 ]; then
>             STARTTIMEOUT=10
>             while [ $STARTTIMEOUT -gt 0 ]; do
>                 RESPONSE=`/usr/bin/mysqladmin -uUNKNOWN_MYSQL_USER ping
> 2>&1` &&
>  break
>                 echo "$RESPONSE" | grep -q "Access denied for user" &&
> break
>                 sleep 1
>                 let STARTTIMEOUT=${STARTTIMEOUT}-1
>             done
>             if [ $STARTTIMEOUT -eq 0 ]; then
>                     echo "Timeout error occurred trying to start MySQL
> Daemon."
>                     action $"Starting $prog: " /bin/false
>             else
>                     action $"Starting $prog: " /bin/true
>             fi
>         else
>             action $"Starting $prog: " /bin/false
>         fi
>
> I.e. an "Access denied for user" is also considered as an indication
> that the server is up.
>
> Lars

If that's the case then I'll update my server. Will see.

Sasa




More information about the users mailing list