Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use Mysql in QGIS. But when I want to create a new connection to the database (Add Vector Layer), I can't connect because QGIS is looking for


But I'm using XAMPP for Mac OS X so the socket is in


Is there a way to change the path to the mysql socket in QGIS ?

Thank you.

share|improve this question
Is Qgis actually using the local socket directly? My MySQL connection dialog only has host/port/user/pass settings and so for a local DB it would go via loopback network on 'localhost'... Qgis 1.7.4, maybe local socket connections are a new thing... – Spacedman Sep 21 '12 at 10:07
@Spacedman Yes, it's using it directly, I only specified localhost and when I try to connect, It says that the socket /tmp/mysql.sock couldn't be accessed (normal, because it doesn't exist :)) – Julien Fouilhé Sep 21 '12 at 10:18
up vote 1 down vote accepted

I'm currently solving my problem using a simple:

ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock

I know that's not a clean solution but it's the easier I found.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.