文章目录
一、清理
-
卸载自带 postfix
$ rpm -q postfix postfix-2.6.6-6.el6_5.x86_64 $ rpm -ev postfix --nodeps
二、编译安装MySQL 5.1
-
安装编译环境
$ yum -y groupinstall "Development Tools" -
获取源码包
$ cd /opt;wget https://cdn.mysql.com/archives/mysql-5.1/mysql-5.1.71.tar.gz -
配置国内 yum 源
$ wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo $ yum clean all $ yum makecache -
编译安装
- 创建用户、组 $ groupadd mysql $ useradd mysql -s /sbin/nologin -g mysql -M - 安装依赖包 $ yum -y install ncurses-devel - 创建安装目录 $ mkdir -p /usr/local/mysql - 编译安装 $ tar zxvf mysql-5.1.71.tar.gz $ cd mysql-5.1.71 $ ./configure \ --prefix=/usr/local/mysql/ \ --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock \ --localstatedir=/usr/local/mysql/data \ --enable-assembler \ --enable-thread-safe-client \ --with-mysqld-user=mysql \ --with-big-tables \ --without-debug \ --with-pthread \ --enable-assembler \ --with-extra-charsets=complex \ --with-readline \ --with-ssl \ --with-embedded-server \ --enable-local-infile \ --with-plugins=partition,innobase \ --with-mysqld-ldflags=-all-static \ --with-client-ldflags=-all-static $ make && make install -
配置
- 创建mysql数据文件目录 $ mkdir -p /application/mysql/data - 创建配置文件 $ cp /opt/mysql-5.1.71/support-files/my-medium.cnf /etc/my.cnf - 创建启动脚本 $ cp -r /opt/mysql-5.1.71/support-files/mysql.server /etc/init.d/mysqld - 权限配置 $ chown -R mysql:mysql /usr/local/mysql $ /usr/local/mysql/bin/mysql_install_db --user=mysql - 环境变量 $ echo "export PATH=/usr/local/mysql/bin:$PATH" >> /etc/profile $ source /etc/profile -
启动 MySQL
-设置开机自动启动 $ chkconfig --add mysqld $ chmod a+wrx /etc/init.d/mysqld $ /etc/init.d/mysqld start -
MySQL 初始化配置
$ /usr/local/mysql/bin/mysql_secure_installation Enter current password for root (enter for none): # 输入当前 root 在 mysql 中的密码,一般为空,所以直接回车; Set root password? [Y/n] y # 是否为 root 设置密码? Remove anonymous users? [Y/n] y # 是否移除匿名用户? Disallow root login remotely? [Y/n] n # 是否拒绝 root 远程登录? Remove test database and access to it? [Y/n] y # 是否移除test库和对test库的访问权限? Reload privilege tables now? [Y/n] y # 是否刷新授权表使修改生效?
至此,MySQL安装完成;
三、安装 cyrus-sasl 并启动 saslauthd 服务
$ yum -y install cyrus-sasl cyrus-sasl-devel
$ service saslauthd start
$ chkconfig saslauthd on

最低0.47元/天 解锁文章
4192

被折叠的 条评论
为什么被折叠?



