1
Taps Server Error: Mysql::Error: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I get this error whenever I try to push my local mysql to heroku postgres. It seems that mysql is misconfigured and that windows is highly unlikely to have a var/run directory. I can understand that I need to force mysql to connect over tcp and not through socket. I checked the tutorials but its kind of not helping me any more can anyone help me with this ? I am using windows 7.

user9517
  • 114,104
  • 20
  • 206
  • 289
joar
  • 11
  • 1
  • What triggers the MySQL connection? Is it done manually from the commandline or through a build-script? – pkhamre Mar 28 '12 at 07:25
  • actually i use wamp server locally. . . – joar Mar 28 '12 at 07:47
  • Can you explain what triggers the error message you posted? If I know what starts the MySQL connections, it will be easier to help you to configure it correctly. – pkhamre Mar 28 '12 at 07:49
  • okay actually i have my code done in php and in mysql(localhost) ,so when i try to push to heroku,the remote server cannot able to make a connection with the local mysql of mine since mysql connects through socket and hence the error msg.pity me if am still not able to answer your question – joar Mar 28 '12 at 07:58
  • What kind of application is this? If it has any property files you can probably define different MySQL connections for development and for production. – pkhamre Mar 28 '12 at 08:00
  • this is a facebook application and do i have to make any change in the my.ini file? i made changes like removing the line #skip networking in order to connect over tcp but that didnt make any difference either. . . – joar Mar 28 '12 at 08:17
  • The file `my.ini` is for global mysql configuration and is read your local MySQL server. The MySQL-connection settings is probably located in your codebase someplace. – pkhamre Mar 28 '12 at 08:20

1 Answers1

0

i think you have tried to shift you mysql.ini file from you linux machine to windows..or something like that... please check the location of your socket file in mysql.ini where it is located..i in mysql.inin file the path is /var/run/mysqld/mysqld.sock but on windows it fails to load that file.By default while installing mysql server you will get the socket path as '/tmp/mysql.sock '

matang
  • 446
  • 1
  • 4
  • 5