Compile and install mysql error reporting solution under centos

  • 2020-04-01 01:10:33
  • OfStack

Today in centos6.2 the following source compiler installation of mysql, when compiling mysql reported a ball error:
 
[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_READLINE=1  
> -DENABLED_LOCAL_INFILE=1  
> -DMYSQL_DATADIR=/var/mysql/data 
-bash: /usr/bin/cmake: No such file or directory 

I know this problem because I use the cmake system to go back to the default /usr/bin, but the cmake installed in SRC is in /usr/local/bin, so of course I won't find it. Solutions:
1. Make a link: ln-s /usr/local/bin/cmake /usr/bin
2. Directly use /usr/local/bin/cmake to compile.

Related articles: