MySQL 資料(資料庫)遷移

來源:互聯網
上載者:User

標籤:

 

尋找MySQL真正的Data目錄

show variables like ‘datadir‘;+---------------+-----------------+| Variable_name | Value           |+---------------+-----------------+| datadir       | /var/lib/mysql/ |+---------------+-----------------+

 

步驟:

關閉apache,tomcat

關閉MySQL

移動/var/lib/mysql/對應的檔案夾到新的位置

重新軟串連/var/lib/mysql/到新的位置

啟動MySQL

啟動apache,tomcat

 

簡略步驟:

先停止mysql:
/etc/init.d/mysqld stop
移動資料:
mv /var/lib/mysql/* /home/mysql/
建立軟串連:
ln -s /home/mysql/ /var/lib/mysql/
啟動mysql:
/etc/init.d/mysqld start

 

 

REF:

資料庫遷移

http://www.cnblogs.com/advocate/archive/2013/11/19/3431606.html

http://sofar.blog.51cto.com/353572/1598364/

資料檔案路徑遷移

http://blog.chinaunix.net/uid-77311-id-4530910.html

http://www.jb51.net/article/47897.htm

http://www.weste.net/2013/6-4/91953.html
http://crx.xmspace.net/linux_mv_mysql_data.html

 

MySQL 資料(資料庫)遷移

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.