現在最重要的是如何將原來的數據恢復出來? WEB和FTP比較容易解決,直接將硬盤作為從盤掛到其它的機子上,將數據copy出來就可以了。
SVN也比較方面, 使用“ dump”和“ ”
MySQL的數據如何恢復?首先要找到mysql數據庫的位置。我原來使用的是 8。看看是不是在/var/lib/mysql/mysql下面。
將原來數據庫文件copy出來,然后編輯 /etc/f, 修改mysql數據庫目錄,試試看看行不行?
將/var/lib/mysql/打包mysql數據庫文件恢復,放到 15下面,mysql版本是“mysql Ver 14.14 5.1.47“
運行/sbin/ start, 有錯誤:
09:40:32 with from /home/frank//mysql
/usr//: Table 'mysql.' doesn't exist
9:40:32 [ERROR] Can't open the mysql. table. run to it.
9:40:32 : ; log 0 43665
9:40:32 [ERROR] Fatal error: Can't open and lock : Table 'host' is read only
09:40:32 from pid file /var/run//.pid ended
將myql下目錄copy到/var/lib/mysql下面,運行
mysql> use ;
mysql> show ;
ERROR 1018 (HY000): Can't read dir of './/' (errno: 13)
看來這個方法也不行。
使用"":
[root@ log]# --user=mysql --=/home/frank//mysql
MySQL ...
ERROR: 1 Can't /write to file '/home/frank//mysql/mysql/.MYI' (: 13)
10:34:19 [ERROR]
10:34:19 [Note] /usr//:
of ! the logs in
/home/frank//mysql for more .
You can try to start the with:
shell> /usr// --skip-grant &
and use the line tool /usr/bin/mysql
to to the mysql and look at the grant :
shell> /usr/bin/mysql -u root mysql
mysql> show
Try ' --help' if you have with paths. Using --log
gives you a log in /home/frank//mysql that may be .
the MySQL
' ', and the that
on your OS. are the
MySQL email at
check all of the above us! And , if
you do mail us, you MUST use the /usr/bin/ !
[root@ log]#
更換目錄,再試一次
[root@ mysql]# --user=mysql --=/opt//mysql/
MySQL ...
OK
help ...
OK
To start at boot time you have to copy
-files/mysql. to the right place for your
TO SET A FOR THE MySQL root USER !
To do so, start the , then issue the :
/usr/bin/ -u root 'new-'
/usr/bin/ -u root -h 'new-'
you can run:
/usr/bin/ation
which will also give you the of the test
and user by . This is
for .
See the for more .
You can start the MySQL with:
cd /usr ; /usr/bin/ &
You can test the MySQL with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
any with the /usr/bin/ !
啟動mysql還是失敗mysql數據庫文件恢復,查看log:
10:46:55 with from /opt/
10:46:55 : error 13 in a file .
: The error means does not have the to
: the .
: File name ./
: File call: 'open'.
: .
10:46:55 from pid file /var/run//.pid ended
似乎是權限問題
更改權限
chown mysql:mysql -R /
然后啟動mysql
[root@ opt]# /sbin/
: [ OK ]
: [ OK ]
再驗證一下mysql中的數據
[root@ opt]# mysql --=/opt//mysql.sock -u root -p
成功連接
下面將中的數據備份出來
備份mysql數據庫數據
[root@ opt]# --=/opt//mysql.sock -u root - --opt > .sql
然后再將數據庫導入到新的mysql服務器中。
最后再導入mysql的備份機制