Linux下源碼編譯安裝MySQL 5.5.8 |
發(fā)布時間: 2012/9/18 17:18:26 |
準備工作: 新建用戶和用戶組 groupadd mysql useradd -g mysql mysql 1:下載: bison-2.4.2.tar.bz2 cmake-2.8.3.tar.gz make-3.82.tar.gz bzr-2.3b5.tar.gz - mysql-5.5.8.tar.gz 2:解壓安裝前3個包 tar zxvf cmake-2.8.3.tar.gz cd cmake-2.8.3 ./configure make make install tar zxvf make-3.82.tar.gz cd make-3.8.2 ./configure make make install tar jxvf bison-2.4.2.tar.bz2 cd bison-2.4.2 ./configure make make install 3:解壓mysql-5.5.8.tar.gz tar zxvf mysql-5.5.8.tar.gz cd mysql-5.5.8 cmake . \ -DCMAKE_INSTALL_PREFIX=/mysql/mysqldir \ -DMYSQL_DATADIR=/mysql/mysqldir/data \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DMYSQL_TCP_PORT=3306 \ -DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock \ -DMYSQL_USER=mysql \ -DWITH_DEBUG=0 報錯(如無報錯直接make & make install 即可): CMake Error at cmake/readline.cmake:82 (MESSAGE): Curses library not found. Please install appropriate package, remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on RedHat and derivates it is ncurses-devel. Call Stack (most recent call first): cmake/readline.cmake:126 (FIND_CURSES) cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT) CMakeLists.txt:256 (MYSQL_CHECK_READLINE) -- Configuring incomplete, errors occurred! 缺少包:ncurses-devel 解決: 到安裝光盤或者網(wǎng)上DOWN相應(yīng)的包 安裝: rpm -ivh ncurses-devel*.rpm rm -f CMakeCache.txt cmake . \ -DCMAKE_INSTALL_PREFIX=/mysql/mysqldir \ -DMYSQL_DATADIR=/mysql/mysqldir/data \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DMYSQL_TCP_PORT=3306 \ -DMYSQL_UNIX_ADDR==/mysql/mysqldir/data/mysql.sock \ -DMYSQL_USER=mysql \ -DWITH_DEBUG=0 make make install 完成后進入MYSQL安裝目錄 cd /mysql/mysqldir cp support-files/my-huge.cnf /etc/my.cnf vi /etc/my.cnf 將數(shù)據(jù)目錄和套接字文件修改為實際值. 修改權(quán)限 chown mysql:mysql /etc/my.cnf chown -R mysql:mysql /mysql/mysqldir 切換用戶進入安裝目錄 su - mysql cd /mysql/mysqldir cp scripts/mysql_install_db . ./ mysql_install_db 啟動MYSQL bin/mysqld_safe & OK
本文出自:億恩科技【mszdt.com】 服務(wù)器租用/服務(wù)器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM] |