运行时rake db:migrate,我收到此错误:
Mysql2::Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Run Code Online (Sandbox Code Playgroud)
我在这里查看了其他人的问题,他们的解决方案都没有帮助我,例如:
解决方案一
mysql.server start
Run Code Online (Sandbox Code Playgroud)
收益:
Starting MySQL
Run Code Online (Sandbox Code Playgroud)
.错误!服务器退出而不更新PID文件(/usr/local/var/mysql/something.pid).
解决方案二
mysqladmin variables | grep socket
Run Code Online (Sandbox Code Playgroud)
收益:
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
Run Code Online (Sandbox Code Playgroud)
进一步说明: 我尝试使用自制程序重新安装mysql,这是成功的,我仍然收到相同的错误:
Error: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Run Code Online (Sandbox Code Playgroud) Ruby v2.4.1 - Rails v5.0.6
运行后rake db:migrate,这是我收到的错误:
LoadError: incompatible library version
.. /.rvm/gems/ruby-2.4.1/gems/bindex-0.5.0/lib/bindex/cruby.bundle
如果您能提供帮助,请先致谢!