昨天我在使用安装在我的电脑上的MySQL。
我下载了xampp,所以我在my.cnf
文件中更改了套接字路径:
/opt/lampp/var/mysql/mysql.sock
那个文件就在那里。今天我想继续处理它,但是发现文件不见了,所以当我启动mysql服务器时会出现以下错误:
ERROR 2002 (HY000):
Can't connect to local MySQL server through socket
'/opt/lampp/var/mysql/mysql.sock' (2)
以下是我进行的一些测试:
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服务器,以防万一。无论如何,那个文件不再存在。
编辑: mysql.sock应该在哪里,实际上有两个文件,mysql_upgrade_info(仅包含5.5.8)和另一个名为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
抱歉,我不知道如何以适当的方式显示终端消息在应用程序中。有人可以帮助我吗?提前感谢!