Here is the startup script:

#!/bin/sh
#
# /Library/StartupItems/MySQLCOM/MySQLCOM
#
# A script to automatically start up MySQL on system bootup
# for Mac OS X. This is actually just a wrapper script around
# the standard mysql.server init script, which is included in
# the binary distribution.
#
# (c) 2003 MySQL AB
# Written by Lenz Grimmer <[EMAIL PROTECTED]>
#

# Suppress the annoying "$1: unbound variable" error when no option
# was given
if [ -z $1 ] ; then
        echo "Usage: $0 [start|stop|restart] "
        exit 1
fi

# Source the common setup functions for startup scripts
test -r /etc/rc.common || exit 1
. /etc/rc.common

# The path to the mysql.server init script. The official MySQL
# Mac OS X packages are being installed into /usr/local/mysql.
SCRIPT="/usr/local/mysql/support-files/mysql.server"

StartService ()
{
        if [ "${MYSQLCOM:=-NO-}" = "-YES-" ] ; then
                ConsoleMessage "Starting MySQL database server"
                $SCRIPT start > /dev/null 2>&1
        fi
}

StopService ()
{
        ConsoleMessage "Stopping MySQL database server"
        $SCRIPT stop > /dev/null 2>&1
}

RestartService ()
{
        ConsoleMessage "Restarting MySQL database server"
        $SCRIPT restart > /dev/null 2>&1
}

if test -x $SCRIPT ; then
        RunService "$1"
else
        ConsoleMessage "Could not find MySQL startup script!"
fi

The grant command was:

grant all on *.* to [EMAIL PROTECTED] identified by 'my_password';

Thanks for the help,
C.

On 7/14/05, Danny Stolle <[EMAIL PROTECTED]> wrote:
> Michael Stassen wrote:
> > Danny Stolle wrote:
> >
> >> Chris Fonnesbeck wrote:
> >>
> >>> I have mysql 4.1.12 installed on OSX 10.4, and have run into the
> >>> curious problem that mysql forgets my user password (but not my root
> >>> password) when I restart the server. When I attempt to log in, I get:
> >>>
> >>> ERROR 1045 (28000): Access denied for user 'chris'@'localhost' (using
> >>> password: YES)
> >>>
> >>> Yet, when I go in as root and re-grant permissions with the user
> >>> password, access is restored. When I reboot, I get the error again.
> >>> What could possibly be causing this?
> >>>
> >>> Thanks,
> >>> Chris Fonnesbeck
> >>>
> >>
> >> Sorry again ... forgot the mailing group ...
> >>
> >> "Did you 'flush privileges'?"
> >>
> >> Danny Stolle
> >> Netherlands
> >
> >
> > Danny,
> > First, FLUSH PRIVILEGES is not needed with GRANT.  Second, if he were
> > editing the user table instead of using GRANT and failing to FLUSH
> > PRIVILEGES, he would get the opposite behavior -- the login would not
> > work before the restart, but would work after.
> >
> > Chris,
> > One possibility is a startup script which is altering the user table.
> > Another possibility is some error in granting permissions or restarting
> > the server, or logging in.  It is difficult to say without knowing
> > more.  Please show us
> >
> > * the GRANT command you use to create 'chris'@'localhost' (but don't
> > show us
> >   the real password)
> > * the output of "SHOW GRANTS FOR 'chris'@'localhost'" when it is working
> >   (before a restart).
> > * the method you use to restart the server
> > * the output of "SHOW GRANTS FOR 'chris'@'localhost'" when it isn't working
> >   (after the restart).
> >
> > Michael
> >
> >
> 
> Aah I get the picture, thanx Michael.
> 
> Danny
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to