mysql 5.5 重新编译_源码编译mysql5.5过程记录
CentOS6.3源碼安裝mysql-5.5.27
#mysql5.5以上使用cmake代替configure編譯,首先需要安裝cmake
yum install cmake
# 建mysql用戶和組
shell> groupadd mysql
shell> useradd -r -g mysql mysql
# 解壓tgz包,編譯mysql
shell> tar zxvf mysql-5.5.27.src.tar.gz
shell> cd mysql-5.5.27
shell> cmake .
shell> make && make install
# 編譯結束
# 更改用戶和組屬性,執行mysql_install_db初始化數據庫
shell> cd /usr/local/mysql
shell> chown -R mysql:mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# (以下命令可選)拷貝配置文件到/etc目錄下,啟動mysql
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
# (以下命令可選)設置mysql開機自啟動
shell> cp support-files/mysql.server /etc/init.d/mysql.server
安裝過程并不順利,遇到好幾次錯誤
1.沒有安裝 gcc 和 gcc-c++,執行cmake報如下錯誤:
==================================================
[root@ice mysql-5.5.27]# cmake .
-- 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.
.
.
.
-- Configuring incomplete, errors occurred!
==================================================
解決方法:安裝gcc和gcc-c++
yum install gcc
yum install gcc-c++
#刪除cache文件,不刪除還會報錯
rm CMakeCache.txt
cmake .
2.編譯快結束時,又報如下錯誤:
Warning: Bison executable not found in PATH
解決方法:安裝bison
yum install bison
rm CMakeCache.txt
cmake .
#編譯通過
make && make install
#執行時間比較長
3.無法啟動mysql
bin/mysqld_safe --user=mysql & 無法啟動
解決方法:
再執行一次scripts/mysql_install_db --user=mysql
為什么會這樣,原因不明
總結
以上是生活随笔為你收集整理的mysql 5.5 重新编译_源码编译mysql5.5过程记录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 造车梦终成真!FF 91 Futuris
- 下一篇: 历史时刻!法拉第未来宣布FF 91量产