看板 Linux 關於我們 聯絡資訊
板上各位大家好 前言: 作業系統是Ubuntu,最近在學校打工幫忙維護Drupal的網頁 昨天接到說突然有網頁無法更新的情況 後來我要從後台使用者登入,server卻一直沒有回應 上網爬文過後嘗試了GRANT ALL PRIVILEGES ON databasename.* 指令 之後重新啟動mysql後 Server load 突然變很重, Drupal現在就成線site off-line的狀態 後來我要從command-line連線mysql時 出現以下錯誤: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) telnet 發現 mysql 3306 沒有運作 然後/var/run/mysqld也是空的 上網爬文後發現別人的解決方法 1.重灌mysql,可是我怕一重灌mysql,Drupal會整個掛掉 2.有人說/var/lib/mysql站太多容量了,要減肥 可是這裡面都是資料庫的資料表,若要備份該如何下手? 還是能在/var/run/mysqld 底下新增mysqld.sock的檔案呢? 麻煩各位了 ------------------------------- + set -e + basename /etc/init.d/mysql + INITSCRIPT=mysql + JOB=mysql + [ mysql = upstart-job ] + [ -z start ] + COMMAND=start + shift + [ -z ] + ECHO=echo + echo Rather than invoking init scripts through /etc/init.d, use the service(8) Rather than invoking init scripts through /etc/init.d, use the service(8) + echo utility, e.g. service mysql start utility, e.g. service mysql start + echo + echo Since the script you are attempting to invoke has been converted to an Since the script you are attempting to invoke has been converted to an + echo Upstart job, you may also use the start(8) utility, e.g. start mysql Upstart job, you may also use the start(8) utility, e.g. start mysql + awk /[0-9]$/ { print $NF } + status mysql + PID= + [ -z ] + [ start = stop ] + [ -n ] + [ -z ] + [ start = restart ] + start mysql start: Job failed to start -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.33.236.49 ※ 編輯: taurus510 來自: 114.33.236.49 (05/24 14:46)
rellik:socket 沒起來的話表示 mysql 沒跑起來, 你應該先從log看有 05/24 15:54
rellik:無錯誤訊息? 05/24 15:54
taurus510:mysql.log一片空白QQ 05/24 17:31
Tetralet:先下 /etc/init.d/mysql start 看看吧 05/24 20:26
Tetralet:Debian/Ubuntu 的 MySQL Log 應該在 /var/log/daemon.log 05/24 20:27
taurus510:T大 start restart 都會顯是一樣的錯誤訊息 05/24 20:37
taurus510:T大你好 daemon.log仍是一片空白 05/24 20:42
Tetralet:那... bash -vx /etc/init.d/mysql start 呢? 05/24 21:32
bibo9901:硬碟滿了? 05/24 21:38
taurus510:有顯示 /var 使用了95% of 5.5GB 05/24 23:03
taurus510:請問是否有關? 05/24 23:03
taurus510:回Tet 大 start failed! 05/24 23:04
Tetralet:嗯... 您是 ssh 進去操作的嗎? 05/24 23:07
taurus510:T大 事的 05/25 00:26
yanli2:直接備份 var資料庫 然後重裝mysql看看 05/25 02:34
taurus510:y大,請問重裝之後Drupal是不是要重新設定呢? 05/25 08:58
Tetralet:請把 sh -x /etc/init.d/mysql start 的輸出完整貼上來.. 05/25 10:29
※ 編輯: taurus510 來自: 114.33.236.49 (05/25 15:31)
taurus510:T大你好,結果貼上來了 05/25 15:32
Tetralet:好奇怪... 這是哪個版本的 Ubuntu 呀? 05/25 17:38
Tetralet:再試試 sh -x service mysql start 吧 05/25 17:42
taurus510:sh: Can't open service 05/25 17:59
taurus510:Ubuntu 10.04 LTS 05/25 17:59
Tetralet:我差點忘了... Ubuntu 已經改用 upstart 來啟動服務了 05/25 18:26
Tetralet:(但... upstart 啟動服務時的資訊怎麼那麼少呀?) 05/25 18:29
Tetralet:看看 /etc/init/mysql.conf 或 /etc/mysql/my.cnf 吧 05/25 18:30
Tetralet:不然只能備份後(請務必先備份!)用以下指令重裝看看了 05/25 18:31
Tetralet:apt-get install --reinstall mysql-server 05/25 18:31
Tetralet:不過... 系統壞了重灌就好,只要把 MySQL 資料夾丟回去, 05/25 19:34
Tetralet:資料庫就回來了。 05/25 19:34
Tetralet:不過密碼則千萬別弄丟了!會很傷腦筋! 05/25 19:34
taurus510:感謝T大,最後解決了。 因為/var/log 太肥厚 05/25 23:45
taurus510:佔太多空間,gzip壓縮後使用 sh -x service mysql start 05/25 23:46
taurus510:終於順利運行了! 05/25 23:46
taurus510:也感謝上面的b大! 05/25 23:46