时间:2021-07-01 10:21:17 帮助过:19人阅读
[root@www cmake-2.8.6]# yum -y install gcc gcc* [root@www cmake-2.8.6]# tar zxf cmake-2.8.6.tar.gz [root@www cmake-2.8.6]# cd cmake-2.8.6 [root@www cmake-2.8.6]# ./configure [root@www cmake-2.8.6]# gmake && gmake install
2、源码编译安装
[root@www cmake-2.8.6]# groupadd mysql [root@www cmake-2.8.6]# useradd -M -s /sbin/nologin mysql -g mysql
[root@www /]# tar zxf mysql-5.5.22.tar.gz [root@www /]# cd mysql-5.5.22
[root@www mysql-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DCMAKE_INSTALL_PREFIX=/usr/local/mysql :指定mysql数据库程序安装目录 -DSYSCONFDIR=/etc :指定初始化参数文件目录 -DDEFAULT_CHARSET=utf8 :指定默认使用的字符集校队规则 -DDEFAULT_COLLATION=utf8_general_ci :是适用UTF-8字符集的通用规则 -DWITH_EXTRA_CHARSETS=all :指定额外支持的其他字符集编码 -- Check size of pthread_t -- Check size of pthread_t - done -- Performing Test HAVE_PEERCRED -- Performing Test HAVE_PEERCRED - Success Warning: Bison executable not found in PATH -- Configuring done -- Generating done -- Build files have been written to: /mysql-5.5.22 [root@www mysql-5.5.22]# yum -y install bison [root@www mysql-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -- Configuring done -- Generating done -- Build files have been written to: /mysql-5.5.22 [root@www mysql-5.5.22]# echo $? 0
[root@www mysql-5.5.22]# make && make install [root@www mysql-5.5.22]# echo $? 0
[root@www mysql-5.5.22]# chown -R mysql:mysql /usr/local/mysql/
在MySQL源码目录中的support-files 文件夹下,提供了适合不同负载数据库的样本配置文件,如果不确定数据库系统的应用规模,一般选择ny-medium.cnf文件即可,该文件能够满足大多数企业的中等应用需求。
[root@www mysql-5.5.22]# rm -rf /etc/my.cnf [root@www mysql-5.5.22]# cp support-files/my-medium.cnf /etc/my.cnf
[root@www mysql-5.5.22]# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/usr/local/mysql/data/
[root@www mysql-5.5.22]# echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile [root@www mysql-5.5.22]# . /etc/profile
[root@www mysql-5.5.22]# cp support-files/mysql.server /etc/init.d/mysqld [root@www mysql-5.5.22]# chmod +x /etc/rc.d/init.d/mysqld [root@www mysql-5.5.22]# chkconfig --add mysqld [root@www mysql-5.5.22]# /etc/init.d/mysqld start Starting MySQL.... SUCCESS! [root@www mysql-5.5.22]# /etc/init.d/mysqld status SUCCESS! MySQL running (28343) [root@www mysql-5.5.22]# netstat -anpt | grep mysqld tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 28343/mysqld
MySQL编译安装
标签: