Home > Database > Mysql Tutorial > 更改数据库文件的数据文件目录位置_MySQL

更改数据库文件的数据文件目录位置_MySQL

WBOY
Release: 2016-06-01 13:34:24
Original
1082 people have browsed it

bitsCN.com


更改数据库文件的数据文件目录位置

 

原来的存放目录/usr/local/mysql/var

新的目录/var/mysql

1.service mysql stop

2.mkdir /var/mysql

  chown -R mysql /var/mysql

  chgrp -R mysql /var/mysql

3.vi /etc/my.cnf  

  add: datadir=/var/mysql

       log-bin=/var/mysql/mysql-bin

4.service mysql start

 

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