MACPORTS - mysql5 install on Leopard - step by step instructions

Bill Hernandez ms at mac-specialist.com
Wed Apr 2 09:46:30 PDT 2008


On Apr 2, 2008, at 6:01 AM, sourceforge.rocks at xemaps.com wrote:
> A step you may want to add is creating a symlink from /tmp/ 
> mysql.sock to /opt/local/var/run/mysql5/mysqld.sock:
>
>     sudo ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock
>
> This is for people who want to use the MySQL Administrator and/or  
> MySQL Query Browser supplied by MySQL



I have not used either, but I would imagine that MySQL Administrator  
and/or MySQL Query Browser probably have a connection profile that  
allows you to specify the correct socket in a similar fashion to the  
Navicat steps I listed below :

Somewhere I was reading yesterday that there was vulnerability  
associated with '/tmp/mysql.sock', so setting the preferences in MySQL  
Administrator with the correct path might be a better solution than  
the soft link to a file that gets created and destroyed every time the  
MySQL-Server starts and stops.

This is a little piece from a previous comment I posted:

To avoid :
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

You will need to make sure MySQL-Server is running by using :

$ ps aux | grep mysql

You should also make sure that the two configuration files "my.cnf",  
and "php.ini" have the same path to where the socket file will be  
created when MySQL-Server starts up..

MACPORTS LOCATIONS :

( a ) /opt/local/etc/mysql5/my.cnf should contain something like :
        [mysqld]
        port = 3306
        socket = /opt/local/var/run/mysql5/mysqld.sock

( b ) /opt/local/etc/php.ini should contain something like :
        [MySQL]
         mysql.default_socket = /opt/local/var/run/mysql5/mysqld.sock

( c ) if using a GUI like Navicat the preferences have to specify the  
correct path for the socket

        If using Navicat try the following :
        ( 1 ) Select a connection profile from the "Connections"  
portion (left side) of the Navicat window
        ( 2 ) Select "Connection --> Connetion Properties..." from the  
menubar
        ( 3 ) Select the "Advanced" tab
        ( 4 ) Check the "Use socket for localhost Connection" checkbox
        ( 5 ) Set the "Socket File Path :" field to "/opt/local/var/ 
run/mysql5/mysqld.sock" without the quotes
        ( 6 ) Click the "Test Connection" button, and if MySQL is  
running you should see "Connetion Successful"

These are handy :

( 1 ) open -a /Applications/BBEdit.app /opt/local/etc/mysql5/my.cnf
( 2 ) open -a /Applications/BBEdit.app /opt/local/etc/php.ini
( 3 ) open /Applications/Navicat.app

Best Regards,

Bill Hernandez
ms at mac-specialist.com





More information about the macports-users mailing list