---
title: "Ubuntu 11.10 下源码安装 mysql 5.5.20"
author: "conkeyn"
date: "2012-02-14T23:11:46Z"
tags: []
categories: ["数据库"]
slug: "ubuntu-11-10-mysql-5-5-20"
draft: false
lastmod: "2012-02-14T23:11:46Z"
id: 1405911
url: "https://conkeyn.iteye.com/blog/1405911"
---

问题：

    [CMAKE\_CXX\_COMPILER-NOTFOUN 问题的解决](http://hi.baidu.com/chixg/blog/item/39b406f3f0393b52342acc12.html)

 

写道

问题描述:  
sudo cmake .后出现如下提示：  
\-- Check for working CXX compiler: CMAKE\_CXX\_COMPILER-NOTFOUND  
CMake Error: your CXX compiler: "CMAKE\_CXX\_COMPILER-NOTFOUND" was not found. Please set CMAKE\_CXX\_COMPILER to a valid compiler path or name.  
CMake Error: Internal CMake error, TryCompile configure of cmake failed  
\-- Check for working CXX compiler: CMAKE\_CXX\_COMPILER-NOTFOUND -- broken  
CMake Error: The C++ compiler "CMAKE\_CXX\_COMPILER-NOTFOUND" is not able to compile a simple test program.  
It fails with the following output:

CMake will not be able to correctly generate this project.  
CMake Error: your CXX compiler: "CMAKE\_CXX\_COMPILER-NOTFOUND" was not found. Please set CMAKE\_CXX\_COMPILER to a valid compiler path or name.  
\-- Configuring done

解决办法:  
1\. sudo apt-get install g++

2\. cmake -D CMAKE\_CXX\_COMPILER="g++" CMAKE -D CMAKE\_BUILD\_TYPE=Release -D CMAKE\_INSTALL\_PREFIX:PATH="/usr/local" .

 

cmake 命令及参数，需要去掉换行 哦。

 

```
cmake . 
-DCMAKE_INSTALL_PREFIX=/usr/mysql 
-DMYSQL_DATADIR=/usr/mysql/data 
-DDEFAULT_CHARSET=utf8 
-DDEFAULT_COLLATION=utf8_general_ci 
-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock 
-DWITH_DEBUG=0 
-DWITH_INNOBASE_STORAGE_ENGINE=1 
-DENABLED_LOCAL_INFILE=1 
-DWITH_ARCHIVE_STORAGE_ENGINE=1 
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 
-DWITH_FEDERATED_STORAGE_ENGINE=1 
-DWITH_PARTITION_STORAGE_ENGINE=1 
-DWITH_INNOBASE_STORAGE_ENGINE=1 
-DMYSQL_TCP_PORT=3306 
-DEXTRA_CHARSETS=all 
-DMYSQL_USER=mysql
```

 

d