MySQL 5.5.10 for Linux 安裝
操作系統(tǒng):CentOS 5.5
MySQL:5.5.10
利用CentOS Linux系統(tǒng)自帶的yum命令安裝、升級(jí)所需的程序庫(kù)(RedHat等其他Linux發(fā)行版可從安裝光盤中找到這些程序庫(kù)的RPM包,www.linuxidc.com進(jìn)行安裝):
sudo -s
LANG=C
yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
#先下載cmake
wget http://www.cmake.org/files/v2.8/cmake-2.8.4.tar.gz
#安裝cmake
tar xvzf cmake-2.8.4.tar.gz
./configure
make
make install
#創(chuàng)建mysql用戶名及組
/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
#下載最新的mysql
wget ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.5/mysql-5.5.10.tar.gz
#解壓
tar zxvf mysql-5.5.10.tar.gz
cd mysql-5.5.10
#開始編譯并安裝
/usr/local/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/webserver/mysql/ -DMYSQL_DATADIR=/usr/local/webserver/mysql/data -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DMYSQL_UNIX_ADDR=/usr/local/webserver/mysql/data/mysql.sock -DMYSQL_USER=mysql -DWITH_DEBUG=0
make && make install
chmod +w /usr/local/webserver/mysql
chown -R mysql:mysql /usr/local/webserver/mysql
cp support-files/my-small.cnf /etc/my.cnf
chown mysql:mysql /etc/my.cnf
執(zhí)行下面的
/usr/local/webserver/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/webserver/mysql --datadir=/usr/local/webserver/mysql/data
在/etc/my.cnf 打開下面的InnoDB配置以減少內(nèi)存即可:
default-storage-engine=MyISAM
server-id = 1
innodb_buffer_pool_size = 21M
innodb_additional_mem_pool_size = 2M
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
啟動(dòng):帶--user=mysql
/usr/local/webserver/mysql/bin/mysqld_safe --user=mysql 本文出自:億恩科技【mszdt.com】
服務(wù)器租用/服務(wù)器托管中國(guó)五強(qiáng)!虛擬主機(jī)域名注冊(cè)頂級(jí)提供商!15年品質(zhì)保障!--億恩科技[ENKJ.COM]
|