These are the options to fix this problem:
Option 1: change your host to 127.0.0.1
staging: adapter: mysql2 host: 127.0.0.1 username: root password: xxxx database: xxxx socket: your-location-socket
Option 2: It seems you have 2 connections to you on the MySql server. To find the location of the socket file, follow these steps:
mysqladmin variables | grep socket
for me gives:
mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock' exists!
or
mysql --help
I get this error because I installed XAMPP on my OS X version 10.9.5 for a PHP application. Select one of the default placements here.
I choose rails for default applications:
socket: /tmp/mysql.sock
For my PHP applications, I install XAMPP, so I install my socket here:
socket: /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
OTHER Socket Location in OS X
For MAMPP:
socket: /Applications/MAMP/tmp/mysql/mysql.sock
For the package installer from MySQL:
socket: /tmp/mysql.sock
For MySQL shipped with a Mac OS X server:
socket: /var/mysql/mysql.sock
For Ubuntu:
socket: /var/run/mysqld/mysql.sock
Option 3: If all these settings do not work, you can delete the location of your socket:
staging:
Hope this helps you.
Muhamad Akbar Bin Widayat Sep 22 '15 at 2:43 2015-09-22 02:43
source share