首先安裝必要的庫html
yum -y install gcc*mysql
複製代碼linux
###### 安裝 MYSQL ######
首先安裝camke
1、支持YUM,則sql
yum install -y cmakeide
複製代碼post
2、也能夠源碼安裝url
cd /usr/local/src
spa
#下載cmake
orm
wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz
server
tar zxvf cmake-2.8.7.tar.gz
cd cmake-2.8.7
#安裝cmake
./configure
make
make install
複製代碼
安裝 MYSQL
官網下載 MYSQL5.5版本 linux下源碼包
http://dev.mysql.com/downloads/
安裝
wget http://downloads.mysql.com/archives/mysql-5.5/mysql-5.5.25a.tar.gz -P /usr/local/src/
groupadd mysql
useradd -g mysql mysql
tar zxvf mysql-5.2.25.tar.gz
cd mysql-5.2.25
複製代碼
#cmake . //默認狀況下安裝,安裝目錄爲/usr/local/mysql 數據目錄爲/usr/local/mysql/data
#也能夠指定參數安裝,如指定UTF8,數據引擎等
#具體參照http://dev.mysql.com/doc/refman/ ... ration-options.html
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1
make && make install
cd /usr/local/mysql
chown -R mysql:mysql /usr/local/mysql
./scripts/mysql_install_db --user=mysql -datadir=/mysql/data
#此處如不指定datadir,到啓動時會報錯
chown -R root .
chown -R mysql data
cp support-files/my-medium.cnf /etc/my.cnf
bin/mysqld_safe --user=mysql &
# Next command is optional
cp support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
/etc/init.d/mysqld start
複製代碼
到此,安裝完成
報錯解決文檔:http://blog.slogra.com/post-371.html