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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:34:241134browse

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
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