Linux源碼安裝MySQL 5.6.12 (Cmake編譯)

來源:互聯網
上載者:User

1.安裝make編譯器(預設系統內建)

:http://www.gnu.org/software/make/

tar zxvf make-3.82.tar.gz
cd make-3.82
./configure
make
make install

2.安裝bison

:http://www.gnu.org/software/bison/

tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install

3.安裝gcc-c++

:http://www.gnu.org/software/gcc/

tar zxvf gcc-c++-4.4.4.tar.gz
cd gcc-c++-4.4.4
./configure
make
make install

4.安裝cmake

:http://www.cmake.org/

tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install

5.安裝ncurses

:http://www.gnu.org/software/ncurses/

tar zxvf ncurses-5.8.tar.gz
cd ncurses-5.8
./configure
make
make install

開始安裝MySQL,:http://dev.mysql.com/

準備工作

groupadd mysql
useradd -r -g mysql mysql

解壓並安裝MySQL

tar zxvf mysql-5.5.13.tar.gz
cd mysql-5.5.13
cmake . /
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /
-DINSTALL_DATADIR=/usr/local/mysql/data
make
make install

完成後,繼續下面的操作

cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .

下面的命令是可選的,將mysql的設定檔拷貝到/etc

cp support-files/my-medium.cnf /etc/my.cnf 

啟動mysql:

bin/mysqld_safe --user=mysql &
#啟動mysql,看是否成功
netstat -tnl|grep 3306

上面是一種啟動mysql的方法,還有一種簡單的方便,如下:

#將mysql的啟動服務添加到系統服務中
cp support-files/mysql.server /etc/init.d/mysql.server
#現在可以使用下面的命令啟動mysql
service mysql.server start
#停止mysql服務
service mysql.server stop
#重啟mysql服務
service mysql.server restart

將mysql服務添加到開機啟動項,讓mysql服務開機啟動

chkconfig --add mysql.server

重啟機器後,mysql服務就會自動啟動了。

基於Cmake編譯安裝MySQL 5.5 

使用Cmake方式安裝mysql-5.5.10 

CentOS下 MySQL 5.5.13 Cmake 安裝筆記 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.