昨天我正在使用我的電腦上安裝的MySQL。
我下載的XAMPP,所以我有我改變了對my.cnf
文件的路徑套接字:Mysql問題:沒有mysql.sock
/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)
這裏有一些測試中,我提出:
[email protected]:~$ ps -fea | grep mysqld
1000 15707 15615 0 16:28 pts/1 00:00:00 grep --color=auto mysqld
[email protected]:~$ 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:
[email protected]:/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
(對不起,我不知道如何以適當的方式顯示終端消息) 任何人都可以幫助我嗎?提前致謝!
問題是我沒有mysql.sock文件 – 2011-04-03 15:17:07
你還沒有證明mysql正在運行 – BugFinder 2011-04-03 15:20:21
你是否手動啓動mysql服務? – 2011-04-03 15:26:34