When mysql is compiled and installed in centos, the following error is reported: www.2cto.com Java code [root @ vps870 mysql-5.5.28] # cmake-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \>-DMYSQL_UNIX_ADDR =/tmp/mysql. sock \>-DDEFAULT_CHARSET = gbk \>-DDEFAULT_COLLATION = gbk_chinese_ci \>-DWITH_EXTRA_CHARSETS: STRING = gbk, gb2312, utf8 \>-DWITH_MYISAM_STORAGE_ENGINE = 1 \>-DWITH_INNOBASE_STORAGE_ENGINE = 1 \>-DWITH_R EADLINE = 1 \>-DENABLED_LOCAL_INFILE = 1 \>-DMYSQL_DATADIR =/var/mysql/data-bash:/usr/bin/cmake: no such file or directory later knows this problem because you directly use the cmake system to return to the default/usr/bin for search, but the cmake installed in src is in/usr/local/bin, so of course this stuff won't be found. Solution: 1. Create a link: ln-s/usr/local/bin/cmake/usr/bin2. directly use/usr/local/bin/cmake for compilation.