Wednesday, February 21, 2007

MacPorts MySql server install howto

I have a nice new macbook and wanted to setup my development tools; eclipse, php, macports, and mysql. Here is the steps to get mysql server working (mysql5 in my case):


# install server and the launch script
# needed to start it. (I like the -v option
# to see what is happening.)
#
$ sudo port -v install mysql5 +server

# initialize the setup as mysql user.
#
$ sudo -u mysql mysql_install_db5

# start mysql and set your root password.
#
$ sudo -u mysql /opt/local/lib/mysql5/bin/mysqld_safe &
$ sudo /opt/local/lib/mysql5/bin/mysqladmin -u root password '[new_passwd]'

5 comments:

  1. This was helpful to me. Thanks for posting it.

    ReplyDelete
  2. Thanks for this incantation. It worked like a charm.

    ReplyDelete
  3. Thank you very much! I still have one question though, how can I set MySQL5 to run when I turn on my Mac?

    ReplyDelete
  4. http://velocipeek.com/2007/11/12/os-x-leopard-startup-script-for-mysql/

    ReplyDelete
  5. Mijndert, there you go (see karwas posting)!

    Karwas, thanks for the tip!

    ReplyDelete