Home  >  Article  >  Database  >  MySQL转移数据文件_MySQL

MySQL转移数据文件_MySQL

WBOY
WBOYOriginal
2016-06-01 13:26:15962browse

bitsCN.com

Ubuntu 12.04下如何转移呢?这篇讨论给了大致的方向:

http://askubuntu.com/questions/224/how-to-i-move-mysql-data-files-onto-different-partition

默认数据文件路径是/var/lib/mysql 目录,但是磁盘空间太小,我想放到/home/data/mysql目录下。

首先停止mysql 服务

service mysql stop 
cp -r /var/lib/mysql/* /home/data/mysql/
放开权限
chmod -R 777 /home/data/mysql 
datadir         = /home/data/mysql
alias /var/lib/mysql/ -> /home/data/mysql/,
启动 mysql 即可。原来的数据文件此时可以删除了。 

 

bitsCN.com
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