Home  >  Article  >  Database  >  Ubuntu 12.04 Server 移植 MySQL 的Database

Ubuntu 12.04 Server 移植 MySQL 的Database

WBOY
WBOYOriginal
2016-06-07 17:13:281010browse

Ubuntu 12.04正好release 了。怎么把之前HDD的mysql database移植到新的HDD呢? 没办法用phpmyadmin,就算mount 到旧HDD,执行my

原本用 Ubuntu 10.04 LTS的Server,几天前HDD有点故障,系统怀了,跟IT要了个淘汰的80G HDD,,怎么公司就这么穷,还是用7,8年前的淘汰电脑做server,IT弟弟又很阿达吗嘛 恐古力,唉~~。

Ubuntu 12.04正好release 了。怎么把之前HDD的mysql database移植到新的HDD呢? 没办法用phpmyadmin,就算mount 到旧HDD,执行mysql start也无法进入旧的database。用mysqldump也不行。。。

Google说在 /var/lib/mysql 里找找。Google神卦果然其准无比。很简单。就把database的整个目录copy到新HDD的同样目录就可以了。过程中会碰到两个问题:

1: 无法进入mysql目录,要先sudo su 取得root ,然后在进去cp

2:   cp 到新HDD的目录之后,要进去 chown chgrp,不然phpmyadmin会看不到table,只看到database。

更多Ubuntu相关信息见Ubuntu 专题页面 ?tid=2

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn