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
- 解決CMAKE編譯第三方開源軟體需要下載的問題編譯
- 從cmake解決clion編譯生成的可執行檔案(.exe)不可執行的問題編譯
- 編譯rocketmq-console並解決RejectedExecutionException問題編譯MQException
- 交叉編譯庫依賴問題的解決方法編譯
- matlab編譯exe問題具體解決辦法Matlab編譯
- 如何用cmake編譯編譯
- CMake for Mac編譯工具Mac編譯
- VScode編譯opencv(Cmake + MinGW)VSCode編譯OpenCV
- Latex編譯錯誤:Unable to load picture or PDF file 問題解決編譯
- cmake編譯指定自己編譯的庫路徑編譯
- golang windows10下 go build 無法編譯 問題解決GolangWindowsUI編譯
- 記一次Razor Pages無法編譯問題及解決編譯
- 解決 Delegate IDE build/run actions to Maven 編譯兩次的問題IDEUIMaven編譯
- libmemcached編譯問題IBM編譯
- SPI編譯問題編譯
- 從編譯連結到cmake編譯
- 【問題記錄】—.NetCore 編譯問題NetCore編譯
- cmake中新增 -g編譯選項編譯
- Windows下CMake編譯安裝OpenCVWindows編譯OpenCV
- 解決 requests 庫 URL 編碼問題
- 徹底解決Python編碼問題Python
- Java動態編譯優化——URLClassLoader 記憶體洩漏問題解決Java編譯優化記憶體
- 太厲害了!解決了我對編譯的絕大部分問題!編譯
- Linux環境下, 原始碼編譯安裝詳解 (編譯CMake 3.15 和 gcc 5.3.0 為例)Linux原始碼編譯GC
- 異常解決:idea Java 動態編譯失敗,獲取classpath屬性不正確問題解決IdeaJava編譯
- Confluence 6 協同編輯問題解決
- Java動態編譯優化——ZipFileIndex記憶體洩漏問題分析解決Java編譯優化Index記憶體
- 【譯】解決問題比寫程式碼更重要
- AndroidStudiogradle編譯NullPointerException(noerrormessage)解決AndroidGradle編譯NullExceptionErrorORM
- cmake Makefile面試問題面試
- 編譯問題解決:LINK : fatal error LNK1104: 無法開啟檔案“*.dll”編譯Error
- [cmake]如何設定Debug和Release編譯模式編譯模式
- 在WSL下為OpenWRT交叉編譯出CMake編譯
- 資料編號+1 併發問題解決
- go的編譯優化問題Go編譯優化
- nginx 編譯出現的問題Nginx編譯
- Gradle 編譯警告亂碼問題Gradle編譯
- 【譯】Python 是解決任何問題的完美工具Python