您应该自定义这三个变量:
MYSQL_DATADIR
SYSCONFDIR
CMAKE_INSTALL_PREFIX
例:
$cd
$cmake -i .
Would you like to see advanced options? [No]:Yes
Please wait while cmake processes CMakeLists.txt files....
...
Variable Name: CMAKE_INSTALL_PREFIX
Description: install prefix
Current Value: /usr/local/mysql
New Value (Enter to keep current value): /home/user/mysql
...
Variable Name: MYSQL_DATADIR
Description: default MySQL data directory
Current Value: /usr/local/mysql/data
New Value (Enter to keep current value): /home/user/mysql/data
...
Variable Name: SYSCONFDIR
Description: config directory (for my.cnf)
Current Value: /usr/local/mysql/etc
New Value (Enter to keep current value): /home/user/mysql/etc
$make
$make install
而不是cmake -i.你可以使用cmake -D MYSQL_DATADIR = / home / user / mysql / data -D SYSCONFDIR = / home / user / mysql / etc -D CMAKE_INSTALL_PREFIX = / home / user / mysql.