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

MySQL转移数据文件

WBOY
Release: 2016-06-07 16:18:33
Original
848 people have browsed it

Ubuntu 12.04下如何转移呢?这篇讨论给了大致的方向: 默认数据文件路径是/var/lib/mysql 目录,但是磁盘空间太小,我想放到/home/data/mysql目录下。 首先停止mysql 服务 1 service mysql stop 1 cp -r /var/lib/mysql/* /home/data/mysql/ 放开权限 1 chmo

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

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

首先停止mysql 服务

1

service mysql stop 

1

cp -r /var/lib/mysql/* /home/data/mysql/

放开权限

1

chmod -R 777 /home/data/mysql 

1

datadir         = /home/data/mysql

1

alias /var/lib/mysql/ -> /home/data/mysql/,

启动 mysql 即可。原来的数据文件此时可以删除了。 

 

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