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

后端 未结 5 1705
悲&欢浪女
悲&欢浪女 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: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.

提交回复
热议问题