错误2002(HY000):无法通过套接字'/tmp/mysql.sock'连接到本地MySQL服务器(2)

问题描述:

有人花了我一整天的时间来解决此问题,请您帮忙.我安装了最新的XAMPP,现在无法从终端连接到mysql.我检查了.profile文件,并且PATH似乎还可以.有谁知道发生了什么事,有什么解决方案?

Can someone please help as i've spent all day trying to fix this. I installed the latest XAMPP and now i can't connect to mysql from terminal.I checked my .profile file and the PATH seems ok. Does anyone know whats happened and what's the solution?

PATH = $ PATH:/应用程序/XAMPP/xamppfiles/bin 导出路径

PATH=$PATH:/Applications/XAMPP/xamppfiles/bin export PATH

这是一个编程问题,因为我是一个PHP开发人员,试图做我的工作!

THIS IS A PROGRAMMING QUESTION AS I'M A PHP DEVELOPER TRYING TO DO MY JOB!

非常感谢;-)

更新:解决方案是使用(以及.profile文件)更新.bash_profile.

UPDATE: the solution was to update the .bash_profile with (as well as the .profile file)

PATH = $ PATH:/应用程序/XAMPP/xamppfiles/bin 导出路径

PATH=$PATH:/Applications/XAMPP/xamppfiles/bin export PATH

花了整整一天时间试图解决这个问题,所以我希望这可以帮助处于同一位置的任何人;-) http://www.jroller.com/jnicho02/entry/setting_up_xampp_on_the (良好链接)

spent the whole day trying to work this out so i hope this helps anyone in the same position ;-) http://www.jroller.com/jnicho02/entry/setting_up_xampp_on_the (GOOD LINK)

@amphetamachine是正确的-您需要执行以下操作:

@amphetamachine is right - you need to do something like this:

[root@vps ~]# service mysqld start