Home > Database > Mysql Tutorial > Linux中MySQL的数据文件转移位置的问题解决

Linux中MySQL的数据文件转移位置的问题解决

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:54:39
Original
881 people have browsed it

整了一天,参考了n多资料,终于弄好了!!!!!!!想把Linux中MySQL的安装程序和数据文件分开,首先是安装时配置的问题,./con

整了一天,参考了n多资料,终于弄好了!!!!!!!

想把Linux中MySQL的安装程序和数据文件分开,首先是安装时配置的问题,,

./configure --prefix=/program/mysql --with-unix-sock-path=/tmp/mysql.sock --localstatedir=/server/mysql/data --with-charset=gbk --with-extra-charsets=all

其中localstatedir是数据文件的安装位置

其次,mysql用户需要相应的文件夹有操作权限。

chown -R mysql:mysql /program/mysql

chown -R mysql:mysql /server/mysql

再次,初始化数据时需指定文件位置

/program/mysql/bin/mysql_install_db --basedir=/program/mysql --datadir=/server/mysql/data --user=nobody

关键的三步,问题解决了!

作者:成刚@成刚网志&&天宇星空
地址:
欢迎转载、订阅、收藏,转载时请务必以链接形式注明作者和原始出处及本声明!

linux

Related labels:
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
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template