MySQL问题:没有mysql.sock [英] Mysql problem: no mysql.sock

查看:761
本文介绍了MySQL问题:没有mysql.sock的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我正在使用安装在计算机上的MySQL.
我下载了xampp,所以我在my.cnf文件上更改了套接字的路径:

Yesterday I was working using MySQL installed on my computer.
I downloaded xampp, so I have I changed on my.cnf file the path to the socket:

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

那个文件就在那里.今天我想继续努力,发现该文件不再存在,因此在启动mysql服务器时出现以下错误:

That file was just there. Today I wanted to keep working on it, and I found that file is not there anymore, so I am getting the following error while I am starting mysql server:

ERROR 2002 (HY000): 
Can't connect to local MySQL server through socket 
'/opt/lampp/var/mysql/mysql.sock' (2)

这是我进行的一些测试:

Here are some tests I made:

mujeresponja@ubuntu:~$ ps -fea | grep mysqld
1000     15707 15615  0 16:28 pts/1    00:00:00 grep --color=auto mysqld
mujeresponja@ubuntu:~$ ps -fea | grep mysql 
1000     15709 15615  0 16:29 pts/1    00:00:00 grep --color=auto mysql

作为一种可能的解决方案,我卸载了xampp并重新安装,还重新安装了一个新的MySQL服务器,以防万一.无论如何,该文件不再存在.

As a possible solution I uninstalled xampp and reinstall it, and also a new MySQL server, just in case. Anyway, that file is not there anymore.

编辑 应当在mysql.sock所在的地方,有两个文件mysql_upgrade_info(仅包含5.5.8)和另一个二进制文件ubuntu.err:

EDIT Where the mysql.sock should be, instead there are two files mysql_upgrade_info (Which contains just 5.5.8) and another binary file called ubuntu.err:

mujeresponja@ubuntu:/opt/lampp/var/mysql$ sudo cat ubuntu.err 
110403 17:28:52 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
110403 17:28:52 [Note] Plugin 'FEDERATED' is disabled.
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110403 17:28:52 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
110403 17:28:52  InnoDB: Initializing buffer pool, size = 16.0M
110403 17:28:52  InnoDB: Completed initialization of buffer pool
110403 17:28:52  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
110403 17:28:52 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended
110403 17:29:22 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
110403 17:29:22 [Note] Plugin 'FEDERATED' is disabled.
/opt/lampp/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
110403 17:29:22 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use InnoDB's own implementation
InnoDB: Compressed tables use zlib 1.2.3
110403 17:29:22  InnoDB: Initializing buffer pool, size = 16.0M
110403 17:29:22  InnoDB: Completed initialization of buffer pool
110403 17:29:22  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name /opt/lampp/var/mysql/ibdata1
InnoDB: File operation call: 'create'.
InnoDB: Cannot continue operation.
110403 17:29:22 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/ubuntu.pid ended

(对不起,我不知道如何以适当的方式显示终端消息) 有人可以帮我吗?预先感谢!

(Sorry, I don't know how to show terminal messages in an appropiuate way) Can anybody help me on this? Thanks in advance!

推荐答案

您可以找到实际的套接字文件并创建一个指向该套接字文件的符号链接,如下所示:

You can locate the actual socket file and create a symbolic link leading to it as follows:

# check path to socket from mysql settings  
mysqladmin | grep d.sock

# create a symbolic link
ln -s path_to_mysql_socket /opt/lampp/var/mysql/mysql.sock

这篇关于MySQL问题:没有mysql.sock的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆