MySQL QueryBrowser & mysql 5 install

December 2, 2009 § 1 Comment

Using mac as development server is not a very easy thing. Support on official on mac osx latest version is not sufficient to troubleshoot unexpected problem areas.

Most Web 2.0 developers use macports for managing install & uninstall. Again most macports tutorial on mysql 5 is out-of-date. Leave me with no choice but to share my notes here.

If you continue to run into mysqld.sock socket connection issues, follow me and uninstall all mysql.

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/opt/local/var/run/mysql5/mysqld.sock’ (2)

$ sudo port -f uninstall mysql5

Install both mysql 5 and mysql 5 server (Must be done together with this latest version)

$ sudo port install mysql5 mysql5-server

Install mysql system database

$ sudo -u mysql mysql_install_db5

Start mysql server

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

$ sudo /opt/local/lib/mysql5/bin/mysqladmin -u root password ‘password’

Start mysql

$ mysql -u root -p

Enter password:

If you restart your computer and run into sock connection errors, create symbolic link again.

$ sudo ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock
$ sudo mkdir /var/mysql
$ sudo ln -s /opt/local/var/run/mysql5/mysqld.sock /var/mysql/mysql.sock

Your MySQL Query Browser may complaint the same sock connection errors even though your terminal is running mysql.

Server Hostname: localhost

Port: 3306

Username: root

Password: password (or blank)

Query Browser > Preferences > Connections > Advance Options

Connect using socket: /opt/local/var/run/mysql5/mysqld.sock

Once you enter the mysqld.sock path, Query Browser & Workbench will connect mysql. All existing databases & tables will appear.

To view your databases:

$ ls /opt/local/var/db/mysql5

Note: If you install mysql5 from tar ball, your installation & mysql paths are totally different. Macports assigned its own file directory on mysql installation.


§ One Response to MySQL QueryBrowser & mysql 5 install

  • tyler says:

    I’m having a couple of issues that I’m hoping you can help me with. I was working with this tutorial first, but was have issues – and then I came across this blog and I’m still having mysql issues. Mysql and the database seemed to install correctly when using this method but I’m not able to start my mysql server.

    When I enter: $ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist there is no feedback from the terminal.

    Also when I enter: sudo /opt/local/lib/mysql5/bin/mysqladmin -u root password ‘password’ I don’t get feed back also.

    And when I enter: mysql -u root -p the terminal states”-bash: mysql: command not found”


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

What’s this?

You are currently reading MySQL QueryBrowser & mysql 5 install at Web Builders.


%d bloggers like this: