在Centos 5.5 上編譯安裝mysql 5.5.9_Mysql

來源:互聯網
上載者:User

建立mysql使用者 [root@xuhost opt]# useradd -g mysql mysql3307 -s /bin/nologin -d /usr/local/mysql3307
建立資料目錄 [root@xuhost opt]# mkdir /mysqldata/dirdata/mysql3307 [root@xuhost opt]# chown mysql.mysql -R /mysqldata/dirdata/mysql3307

安裝 cmake

[root@xuhost opt]# wget http: //www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz[root@xuhost opt]# tar zxvf cmake- 2.8.4.tar.gz[root@xuhost opt]# ./configure[root@xuhost opt]# cd cmake- 2.8.4[root@xuhost cmake- 2.8.4 ]# make install

安裝mysql 5.5.9

[root@xuhost opt]# tar zxvf mysql- 5.5.9.tar.gz[root@xuhostopt]# cd mysql- 5.5.9[root@xuhost mysql- 5.5.9 ]# cmake . \-DCMAKE_INSTALL_PREFIX=/mysqldata/mysql3307/ \-DMYSQL_DATADIR=/mysqldata/dirdata/mysql3307 \-DWITH_INNOBASE_STORAGE_ENGINE=  \-DENABLED_LOCAL_INFILE=  \-DMYSQL_TCP_PORT=  \-DEXTRA_CHARSETS=all \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8-general_ci \-DMYSQL_UNIX_ADDR=/mysqldata/dirdata/mysql3307 /mysql.sock \-DMYSQL_USER=mysql3307 \-DWITH_DEBUG=[root@xuhost mysql- 5.5.9]# make[root@xuhost mysql- 5.5.9]# make install

複製設定檔

[root@xuhost mysql- 5.5.9]# cp support-files/my-medium.cnf /etc/my.cnf

複製啟動指令碼

[root@xuhost mysql- 5.5.9]# cp support-files/mysql.server /etc/init.d/mysqld[root@xuhost mysql- 5.5.9 ]# chmod  /etc/init.d/mysqld

初始化資料庫 (進到安裝目錄)

[root@xuhost mysql5. 5.9 ]# ./scripts/mysql_install_db –user=mysql –ldata=/ var /mysql

啟動資料庫

[root@xuhost mysql5. 5.9 ]# /etc/init.d/mysqld start

Myslq 5.5 . 以上版本編譯出現錯誤匯總:

CMake Warning: The var iable, 'MYSQL_USER' , specified manually, was not used during the generation.

需要把先行編譯裡面的MYSQL_USER去掉,即可先行編譯成功!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.