Setting up mysql5

Scott Haneda talklists at newgeo.com
Sun Jan 31 17:56:25 PST 2010


On Jan 30, 2010, at 7:17 PM, Harald Hanche-Olsen wrote:

> I just installed mysql5. Compiling it went fine, and running it seems
> to be no problem using the supplied launchd item.
> 
> However, I am unable to connect to the database:
> 
> ; mysql5 -h localhost -u root
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

I believe you need to run mysql5 -u root -p
which will give you a password prompt, The `mysql_install_db5` will have you set a password of some form.

> #; port -v install mysql5-server
> [...]
> #; launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
> #; /opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'
> [... produced an access denied error like the one below
> ... but I seem to have closed that terminal window, so no copy ...]
> ; mysql5 -h localhost -u root
> ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
> 
> It did not seem to make any difference whether or not I ran
> ; sudo -u _mysql mysql_install_db5
> (as recommended at the end of installation) before launchctl load.
> 
> FWIW: This is macports version 1.8.2 on OS X 10.5.8 (intel).

Here is what I got when I installed:
    ###########################################################
    # A startup item has been generated that will aid in
    # starting mysql5-server with launchd. It is disabled
    # by default. Execute the following command to start it,
    # and to cause it to launch at startup:
    #
    # sudo launchctl load -w 
    /Library/LaunchDaemons/org.macports.mysql5.plist
    ###########################################################
    ---> Installing mysql5-server @5.1.42_0
    ******************************************************
    * In order to setup the database, you might want to run
    * sudo -u _mysql mysql_install_db5
    * if this is a new install
    ******************************************************

Here is how I have been getting it to work:

Setup:
    sudo -u _mysql mysql_install_db5

Start the server:
    /opt/local/lib/mysql5/bin/mysqld_safe &

Run the secure server installation script, and follow the interactive instructions:    
    sudo /opt/local/lib/mysql5/bin/mysql_secure_installation

Login:
    mysql5 -u root -p

-- 
Scott * If you contact me off list replace talklists@ with scott@ * 


More information about the macports-users mailing list