Home >Database >Mysql Tutorial >mysql数据文件目录迁移

mysql数据文件目录迁移

WBOY
WBOYOriginal
2016-06-07 16:21:151198browse

以前都是改/etc/my.cnf,再将数据文件移到新的目录下,操作起来比较烦,且易出错,今天学习了一种新的方法,再此记录和分享。 1.停掉mysql service mysqld stop 2.移动数据文件到新目录下mv /var/lib/mysql /data/sas0/ 3.连接目录cd /var/lib/ln -s /data/s

   以前都是改/etc/my.cnf,再将数据文件移到新的目录下,,操作起来比较烦,且易出错,今天学习了一种新的方法,再此记录和分享。

  1.停掉mysql

  service mysqld stop

  2.移动数据文件到新目录下mv /var/lib/mysql /data/sas0/

  3.连接目录cd /var/lib/ln -s /data/sas0/mysql

  4.启动数据库service mysqld start

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