Home > Database > Mysql Tutorial > MySQL转移数据文件_MySQL

MySQL转移数据文件_MySQL

WBOY
Release: 2016-06-01 13:26:15
Original
996 people have browsed it

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 
Copy after login
cp -r /var/lib/mysql/* /home/data/mysql/
Copy after login
放开权限
chmod -R 777 /home/data/mysql 
Copy after login
datadir         = /home/data/mysql
Copy after login
alias /var/lib/mysql/ -> /home/data/mysql/,
Copy after login
启动 mysql 即可。原来的数据文件此时可以删除了。 

 

bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template