# RazorSQL

## Query, Edit, Browse, and Manage Databases

- razorsql.com
- Contact

# Connecting to MySQL for MAMP Installations

By default, the MAMP installation may use a custom local socket file location when launching MySQL. For example, MAMP may use the following:
/Applications/MAMP/tmp/mysql/mysql.sock
Many MySQL tools, such as the MySQL Connector/J JDBC driver, require either the mysql.sock file to be located in a particular location, or TCP/IP networking be turned on in order to connect.
Since the default MAMP installation does not turn on TCP/IP networking, and it uses a custom location for the mysql.sock file, there may be problems when trying to connect.
There are a few ways to solve these issues. The first is to edit the MAMP start and stop scripts so that the mysql.sock location is the default. This can be done by editing the following files:
/Applications/MAMP/bin/startMysql.sh
/Applications/MAMP/bin/stopMysql.sh
Replace
socket=/Applications/MAMP/tmp/mysql/mysql.sock
with
socket=/tmp/mysql.sock
A temporary solution is to open up a terminal window and execute the following:
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock
This will create a symbolic link to the MAMP socket file from the normal socket file location so that the JDBC driver can find it. This link will go away when MAMP is stopped or your machine is restarted.