After a whole day, I got more information by referring to n. Finally, I got it !!!!!!!
To separate MySQL installation programs from data files in Linux, the first problem is the configuration during installation,
. /Configure -- prefix =/program/mysql -- with-unix-sock-path =/tmp/mysql. sock -- localstatedir =/server/mysql/data -- with-charset = gbk -- with-extra-charsets = all
Localstatedir is the data file installation location.
Next, the mysql user needs the corresponding folder to have operation permissions.
Chown-R mysql: mysql/program/mysql
Chown-R mysql: mysql/server/mysql
Again, you must specify the file location during data initialization.
/Program/mysql/bin/mysql_install_db -- basedir =/program/mysql -- datadir =/server/mysql/data -- user = nobody
The three key steps are solved!
Author: Cheng Gang @ Cheng Gang wangzhi & Tianyu star
Address: http://www.chenggang.net/post/43/
You are welcome to repost, subscribe, and add to favorites. Please note the author, original source, and this statement in the form of links during reprinting!