cmake編譯問題解決
2 安裝cmake軟體包
yum install cmake
3 create account of mysql
groupadd mysql
useradd -g mysql mysql
autoreconf –force –install
libtoolize –automake –force
automake –force –add-missing
4 complie the sources
mkdir -p /data/mbdata
tar -xvf mysql-5.6.13.tar.gz
5 cmake
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
— Running cmake version 2.6.4
CMake Error: CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/root/mysql-5.6.13/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
— Configuring incomplete, errors occurred!
real 0m0.017s
user 0m0.006s
sys 0m0.005s
6 上一步cmake報錯了,google得知需要重新yum make下
yum install make
ok
再繼續去cmake
[root@472322 mysql-5.6.13]# time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
— Running cmake version 2.6.4
— The C compiler identification is unknown
— The CXX compiler identification is unknown
CMake Error: your C compiler: “CMAKE_C_COMPILER-NOTFOUND” was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: “CMAKE_CXX_COMPILER-NOTFOUND” was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
— Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:31 (MESSAGE):
no suitable type found
Call Stack (most recent call first):
configure.cmake:621 (TEST_BIG_ENDIAN)
CMakeLists.txt:314 (INCLUDE)
這個錯誤很詭異,google上面有很多,但是每種情況都不同,我只好一個個去try了
— Configuring incomplete, errors occurred!
報錯如下: CMake Error: your C compiler: “CMAKE_C_COMPILER-NOTFOUND” was not found.
沒有安裝 gcc 和 gcc-c++,執行cmake報如上錯誤:
第一次嘗試,執行
yum install -y gcc
yum install -y gcc-c++
7 繼續cmake
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
— Searching 16 bit integer
CMake Error at /usr/share/cmake/Modules/TestBigEndian.cmake:31 (MESSAGE):
no suitable type found
Call Stack (most recent call first):
configure.cmake:621 (TEST_BIG_ENDIAN)
CMakeLists.txt:314 (INCLUDE)
— Configuring incomplete, errors occurred!
第二次嘗試,有人說需要安裝至少5種包
[root@472322 mysql-5.6.13]#
yum install gcc gcc-c++
yum install -y ncurses-devel.x86_64
yum install -y cmake.x86_64
yum install -y libaio.x86_64
yum install -y bison.x86_64
yum install -y gcc-c++.x86_64
然後再cmake,還是報原來的錯誤
最後決定用土辦法了,刪除所有的已經安裝過的,重新再來做一遍吧。
[解決辦法]:刪除原來的mysql-5.6.13目錄,重新解壓縮tar.gz包
rm -rf /root/mysql-5.6.13
cd /root/
tar -xvf mysql-5.6.13.tar.gz
cd /root/mysql-5.6.13
time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56 -DMYSQL_DATADIR=/data56 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
OK,成功了,對linux底層不太熟悉,難道是因為前面沒有事先安裝好各種包而cmake出來錯誤的東西導致後面繼續cmake就一直報錯嗎? 是否是需要準備好各種lib包然後才能yum install cmake呢?然後再安裝mysql才能不報錯呢?
8 build the db directy
time make
time make install
9 init db
ll /usr/local/mysql56/
cd /usr/local/mysql56/
chown -R mysql .
chgrp -R mysql .
cp support-files/my-default.cnf /etc/my56.cnf
scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql56 –datadir=/data56 –defaults-file=/etc/my56.cnf
[root@472322 mysql56]# scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql56 –datadir=/data56 –defaults-file=/etc/my56.cnf
/usr/local/mysql56/bin/mysqladmin -u root password `new-password`
/usr/local/mysql56/bin/mysqladmin -u root -h 472322.ea.com password `new-password`
Alternatively you can ru
–defaults-file argument to mysqld_safe when starting the server
感到資訊有warning,那就重新再執行一遍,原來在做5.6.10安裝測試的時候,init db不管第一次執行失敗或者成功,都可以再執行第二遍的。
相關文章
- CMake編譯Qt工程時的問題編譯QT
- 解決:JPEGImageEncoder編譯問題編譯
- CMake生成OpenCV解決方案&&編譯OpenCV原始碼OpenCV編譯原始碼
- 解決CMAKE編譯第三方開源軟體需要下載的問題編譯
- 從cmake解決clion編譯生成的可執行檔案(.exe)不可執行的問題編譯
- 如何用cmake編譯編譯
- CMake for Mac編譯工具Mac編譯
- 交叉編譯庫依賴問題的解決方法編譯
- matlab編譯exe問題具體解決辦法Matlab編譯
- 編譯OpenVPN及解決相關依賴問題編譯
- cmake編譯指定自己編譯的庫路徑編譯
- CMake入門指南-編譯教程編譯
- 從編譯連結到cmake編譯
- golang windows10下 go build 無法編譯 問題解決GolangWindowsUI編譯
- 轉(解決GLIBC_2.x找不到的編譯問題)編譯
- Latex編譯錯誤:Unable to load picture or PDF file 問題解決編譯
- 記一次Razor Pages無法編譯問題及解決編譯
- SPI編譯問題編譯
- perl 編譯問題!編譯
- jive編譯問題編譯
- Windows下CMake編譯安裝OpenCVWindows編譯OpenCV
- cmake中新增 -g編譯選項編譯
- 解決 Delegate IDE build/run actions to Maven 編譯兩次的問題IDEUIMaven編譯
- 編譯rocketmq-console並解決RejectedExecutionException問題編譯MQException
- 解決 requests 庫 URL 編碼問題
- 解決 apache tomcat 編碼問題ApacheTomcat
- libmemcached編譯問題IBM編譯
- EBS form編譯問題ORM編譯
- cmake Makefile面試問題面試
- maven的編碼問題、解決和疑問Maven
- VScode編譯opencv(Cmake + MinGW)VSCode編譯OpenCV
- 解決「問題」,不要解決問題
- 太厲害了!解決了我對編譯的絕大部分問題!編譯
- 徹底解決VC6在編譯,連結時的假死問題編譯
- 徹底解決Python編碼問題Python
- Python Extension 編譯問題Python編譯
- 請教javac 編譯問題Java編譯
- Myeclipse不能編譯問題Eclipse編譯