2014-03-13 47 views
0

我們的硬盤,與Mageia 3,得到了一個壞塊問題。我們仍然可以閱讀,但無法啓動。我將此磁盤安裝爲輔助磁盤(在另一臺與Fedora 20 Gnome配合使用的計算機上)。我想保存舊磁盤的數據庫(包含Drupal網站),所以我將mariadb和phpmyadmin軟件包安裝在一個帶有Mageia 4的新引導硬盤上,並設置了與舊磁盤相同的密碼(我不知道在那裏存儲MariaDB密碼),將配置文件/etc/my.cnf和文件夾/ var/lib/mysql複製到新磁盤。但mysqld拒絕開始。我得到如何保存MariaDB的數據庫?

# systemctl status mysqld.service 
mysqld.service - MySQL database server 
    Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled) 
    Active: failed (Result: start-limit) since Wed 2014-03-12 18:08:35 ULAT; 2s ago 
    Process: 20618 ExecStartPost=/usr/sbin/mysqld-wait-ready $MAINPID (code=exited, status=1/FAILURE) 
    Process: 20245 ExecStart=/usr/bin/mysqld_safe --nowatch (code=exited, status=0/SUCCESS) 
    Process: 20228 ExecStartPre=/usr/sbin/mysqld-prepare-db-dir (code=exited, status=0/SUCCESS) 
Main PID: 20617 (code=exited, status=1/FAILURE) 

Mar 12 18:08:35 Dell-graphist systemd[1]: Failed to start MySQL database server. 
Mar 12 18:08:35 Dell-graphist systemd[1]: Unit mysqld.service entered failed state. 
Mar 12 18:08:35 Dell-graphist systemd[1]: mysqld.service holdoff time over, scheduling restart. 
Mar 12 18:08:35 Dell-graphist systemd[1]: Stopping MySQL database server... 
Mar 12 18:08:35 Dell-graphist systemd[1]: Starting MySQL database server... 
Mar 12 18:08:35 Dell-graphist systemd[1]: mysqld.service start request repeated too quickly, refusing to start. 
Mar 12 18:08:35 Dell-graphist systemd[1]: Failed to start MySQL database server. 
Mar 12 18:08:35 Dell-graphist systemd[1]: Unit mysqld.service entered failed state. 

或者是更好的,在我的Fedora的電腦,配置MariaDB的讀取舊磁盤數據庫,併產生一個.sql文件?如果是這樣,如何爲此配置MariaDB?

謝謝,如果你能幫到你。

回答

0

BIZ - 我想你可以嘗試做轉儲以下這種方法:

如果您可以訪問文件系統和服務器,你可以使用dump放數據庫的東西準備好恢復。

我不確定這種方法在啓動守護程序時是否也適用。如果你仍然想保存你的東西,那麼值得一試。

另一個不太有趣的選擇是做一個整個mysql/mariadb文件夾的深層拷貝。您需要在複製到「mysql:mysql」後更改目標文件夾的所有權,然後將您的mysql配置更改爲指向新位置。

使用start並查看服務器是否會出現在克隆的目錄中?如果(原始)磁盤中有空洞,您可能仍然會在某些查詢中發現問題。無論哪種方式,只要你得到一個服務器的工作,你應該能夠轉儲到文本文件流。