Linux XAMPP mysql.sock 丢失

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10324997/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:59:35  来源:igfitidea点击:

XAMPP mysql.sock is missing

mysqllinuxxamppmysql.sock

提问by Jacob Krieg

I installed XAMPP from the apachefriends.org following these instructions: http://www.apachefriends.org/en/xampp-linux.html#377.

我按照以下说明从 apachefriends.org 安装了 XAMPP:http: //www.apachefriends.org/en/xampp-linux.html#377

The problem is that file /opt/lampp/var/mysql/mysql.sock is missing. How can i get this file? Thing is I want to run an easy MySQL command learning tool and I get this error that the file is missing. (Warning: PDO::__construct() [pdo.--construct]: [2002] No such file or directory (trying to connect via unix:///opt/lampp/var/mysql/mysql.sock) in /opt/lampp/htdocs/SID/sid.php on line 188)

问题是文件 /opt/lampp/var/mysql/mysql.sock 丢失了。我怎样才能得到这个文件?问题是我想运行一个简单的 MySQL 命令学习工具,但我收到此文件丢失的错误。(警告:PDO::__construct() [pdo.--construct]: [2002] /opt 中没有这样的文件或目录(尝试通过 unix:///opt/lampp/var/mysql/mysql.sock 连接) /lampp/htdocs/SID/sid.php 在第 188 行)

XAMPP is running ok, I started it with sudo /opt/lampp/lampp start. http://localhost/works fine. I checked /opt/lampp/etc/my.cnf and it's ok, it contains this data http://pastebin.me/8d6b367a7ee76be70f944d9b960bb8f0

XAMPP 运行正常,我用 sudo /opt/lampp/lampp start 启动它。http://localhost/工作正常。我检查了 /opt/lampp/etc/my.cnf ,没关系,它包含此数据http://pastebin.me/8d6b367a7ee76be70f944d9b960bb8f0

Please help, how can I get that mysql.sock?

请帮忙,我怎样才能得到那个mysql.sock?

Thanks

谢谢

采纳答案by Pedro

execute the next command in a Terminal windows:

在终端窗口中执行下一个命令:

ps -ax|grep mysql

ps -ax|grep mysql

And you can see a result like this:

你可以看到这样的结果:

--socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock --port=3306

--socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock --port=3306

Bes Regards

问候

PS: I use MAC OS X

PS:我使用 MAC OS X

回答by Branchito

I think you are running other instance of mysql..

我认为您正在运行 mysql 的其他实例..

try this :

尝试这个 :

/opt/lampp/bin/mysql -u *user* -p

and then enter your password when asked for.. Hope this helps..

然后在要求时输入您的密码..希望这有帮助..

I had a similar case, when putting only mysql, because that way it wasnt called lampp stack mysql but /usr/bin/mysql(which you can find typing --> which mysql)

我有一个类似的情况,当只放置 mysql 时,因为那样它不被称为 lampp stack mysql 但是/usr/bin/mysql(你可以找到输入 --> which mysql)

回答by Md. Jahir Alam Raju

in ubuntu

在 ubuntu

/opt/lampp/var/mysql/mysql.sock

/opt/lampp/var/mysql/mysql.sock