Can't connect to local MySQL server through socket '/tmp/mysql.sock'

后端 未结 5 1701
悲&欢浪女
悲&欢浪女 2021-01-14 19:24

I am brand-new to web development and RoR - an uber-noob! - and I\'m taking an online RoR course via lynda.com. Excited to join the StackOverflow community, and would reall

相关标签:
5条回答
  • 2021-01-14 19:39

    I run on the same error and for me the both socket information has shown mysqld. I had two sessions defined in mysql client. I resolved my problem by deleting one session definition and leaving only localhost. After deleting and re-running the application, the connection worked.

    I don't know how it is connected to one another, but it worked, so it might work for someone else too.

    0 讨论(0)
  • 2021-01-14 19:50

    This question is somewhat dated, but it I came across it while researching a similar issue. Confirming the socket location and name with the mysql_config command was instrumental in resolving my problem.

    I was getting the same error and had adjusted the socket entry path in config/database.yml to match where I found the .sock file.

    However beyond the path change, the socket entry in my database.yml file referred to "mysql.sock", as do most of the discussions related to this issue during my search.

    The output of mysql_config was slightly different. It revealed that the file name was "mysqld.sock"...notice the 'd', not mysql.sock. I missed it because I was focussing on the path.

    The mysql installation is on a server only VPS, no client, which may explain the difference in the socket file name.

    0 讨论(0)
  • 2021-01-14 19:50

    Update: I tried again today without having changed anything at all, and it worked fine. Go figure. Wish I knew what happened, though.

    0 讨论(0)
  • 2021-01-14 19:52

    I had the same error and installing mysql again (from the official website) fixed the problem.

    0 讨论(0)
  • 2021-01-14 20:01

    rename CLEARDB_DATABASE_URL to DATABASE_URL in heroku configs

    0 讨论(0)
提交回复
热议问题