标签:
查找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
标签:
原文地址:http://www.cnblogs.com/emanlee/p/4567142.html