Home > Database > Mysql Tutorial > body text

mysql5.6改动数据文件路径

WBOY
Release: 2016-06-07 16:26:38
Original
1183 people have browsed it

mysql5.6更改数据文件路径 实验环境:mysql以rpm包方式安装的 ? 1、关闭mysql ? ?service mysql stop ? 2、创建/home/data/mysql目录,并赋值777权限 ? ?mkdir -p /home/data/mysql ? ?cp -R /var/lib/mysql/* /home/data/mysql/ ? ?chmod -R 777 /home/data/

mysql5.6更改数据文件路径

实验环境:mysql以rpm包方式安装的

?

1、关闭mysql

? ?service mysql stop

?

2、创建/home/data/mysql目录,并赋值777权限

? ?mkdir -p /home/data/mysql

? ?cp -R /var/lib/mysql/* /home/data/mysql/

? ?chmod -R 777 /home/data/mysql

?

3、修改配置文件

? ?vi /etc/my.cnf

?

? ?datadir = /home/data/mysql

? ?socket = /home/data/mysql/mysql.sock

? ?

? ?说明:如果这个配置文件不存在,执行如下命令拷贝一份

? ?cp /usr/share/mysql/my-default.cnf /etc/my.cnf

?

4、重启mysql

? ?service mysql start

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