
我現在完全被難住了,雖然我不是高級用戶,但我了解 Ubuntu,因此嘗試在某些論壇主題的幫助下研究問題。
問題: 今天,很偶然地,mysql 在我的本機筆記型電腦上停止工作。我也無法再啟動該服務
$ sudo mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111
因此,在按照其他帖子的建議進行大量搜尋和檢查檔案權限之後,我決定完全重新安裝 mysql。這也行不通。所以我發現這篇文章需要徹底清除:“無法產生 mysql 主程序:無法執行:沒有這樣的檔案或目錄”
再次不走運,我發現很多其他帖子要么有對我不起作用的解決方案,要么根本沒有任何解決方案。不太確定下一步要嘗試什麼,或者這是否是其他人遇到的常見問題。任何關於我可以運行的測試的建議都將非常感謝來解決這個問題,因為我真的可以讓 mysql 恢復並再次工作。
當我重新安裝mysql時出現的目前錯誤是:
Setting up mysql-client-5.5 (5.5.31-0ubuntu0.13.04.1) ...
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin ...
No apport report written because MaxReports has already been reached
ldconfig deferred processing now taking place
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
所以這意味著 mysql-server-5.5 有問題,但不確定是什麼或為什麼,因為這應該是全新的。
感謝您提供的任何時間和/或建議,丹
更新1 找到了一篇帶有新想法的新帖子,運氣不好,但更多錯誤訊息可能有助於調試此問題
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-server-5.5 (5.5.31-0ubuntu0.13.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)
更新2 mysql中error.log的結果
$ tail /var/log/mysql/error.log
/usr/sbin/mysqld(+0x59043a)[0xb745943a]
/usr/sbin/mysqld(+0x590cd3)[0xb7459cd3]
/usr/sbin/mysqld(+0x585fea)[0xb744efea]
/usr/sbin/mysqld(+0x4c57b9)[0xb738e7b9]
/usr/sbin/mysqld(+0x4b785e)[0xb738085e]
/usr/sbin/mysqld(+0x4ba8f1)[0xb73838f1]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d78)[0xb6e78d78]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xb6c083de]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
retrobadger@Laptop-Badger:~$ tail -n50 /var/log/mysql/error.log
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
130509 11:30:18 InnoDB: Assertion failure in thread 2792295232 in file fsp0fsp.c line 3309
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
10:30:18 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 346064 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x33)[0xb72ea683]
/usr/sbin/mysqld(handle_fatal_signal+0x48c)[0xb71af2fc]
[0xb6ea6400]
/usr/sbin/mysqld(+0x53c7da)[0xb74057da]
/usr/sbin/mysqld(+0x4ee825)[0xb73b7825]
/usr/sbin/mysqld(+0x4eefcc)[0xb73b7fcc]
/usr/sbin/mysqld(+0x59043a)[0xb745943a]
/usr/sbin/mysqld(+0x590cd3)[0xb7459cd3]
/usr/sbin/mysqld(+0x585fea)[0xb744efea]
/usr/sbin/mysqld(+0x4c57b9)[0xb738e7b9]
/usr/sbin/mysqld(+0x4b785e)[0xb738085e]
/usr/sbin/mysqld(+0x4ba8f1)[0xb73838f1]
/lib/i386-linux-gnu/libpthread.so.0(+0x6d78)[0xb6e78d78]
/lib/i386-linux-gnu/libc.so.6(clone+0x5e)[0xb6c083de]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
更新3
May 9 09:51:11 Laptop-Badger mysqld_safe[4193]: 130509 9:51:11 InnoDB: Error: page 11444 log sequence number 7800613976
May 9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: is in the future! Current system log sequence number 7672896206.
May 9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: Your database may be corrupt or you may have copied the InnoDB
May 9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: tablespace but not the InnoDB log files. See
May 9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
May 9 09:51:11 Laptop-Badger mysqld_safe[4193]: InnoDB: for more information.
答案1
為了後代從上面的評論中得到完整的答案
卸載後有 2 個位置可以保留
- 中的設定
/etc/mysql
。如果其中一項設定確實損壞,則您的守護程序可能會出現問題。 - 中的資料庫
/var/lib/mysql
。如果你有一個損壞的資料庫,特別是 innodb,啟動程序將開始修復這些資料庫。如果他們不能,你將無法啟動 mysql。
刪除兩者應該可以幫助您解決任何問題。
請注意,如果刪除,您的資料庫將消失/var/lib/mysql
,如果刪除,您的設定也會消失/etc/mysql
。一定要明白這一點
答案2
鄭重聲明 - 我在升級到 Ubuntu 13.04 時遇到了同樣的錯誤。檢查錯誤日誌說磁碟已滿。
apt-get clean
釋放 700MB &
apt-get -f install
把一切都修好了。希望這可以節省一些人的時間。 :D
答案3
我讀到:“子進程安裝的安裝後腳本返回錯誤退出狀態 1”