昨天我正在使用安装在我的计算机上的 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
(对不起,我不知道如何以适当的方式显示终端消息)有人可以帮我吗?提前致谢!