Heim >Datenbank >MySQL-Tutorial >Linux中MySQL的数据文件转移位置的问题解决

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:54:39864Durchsuche

整了一天,参考了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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn