mysql 5.5.15 linux_CentOS 6.0 安装 MySQL 5.5.15

CentOS 6.0 安装 MySQL 5.5.15

#!/bin/bash

#mysql 依赖

yum -y install gcc make gcc-c++ ncurses-devel openssl-devel

wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz/from/http://mysql.he.net/

wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz

tar zxvf cmake-2.8.5.tar.gz

cd cmake-2.8.5

./bootstrap

gmake

gmake install

cd ../

tar zxvf bison-2.5.tar.gz

cd bison-2.5

./configure

make

make install

cd ../

groupadd mysql

useradd -g mysql mysql

tar zxvf mysql-5.5.15.tar.gz

cd mysql-5.5.15

cmake . \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DMYSQL_DATADIR=/var/mysql/data \

-DMYSQL_TCP_PORT=3306 \

-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1

make & make install

mv /etc/my.cnf /etc/my.cnf-`date +%F`

mkdir -p /usr/local/mysql/etc

cp support-files/my-medium.cnf /usr/local/mysql/etc/my.cnf

mkdir -p /data/mysql/

cd /usr/local/mysql/

chmod 755 scripts/mysql_install_db

chown mysql.mysql -R /usr/local/mysql/

chown mysql.mysql -R /data/mysql/

./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/

cp support-files/mysql.server /etc/init.d/mysqld

chmod 755 /etc/init.d/mysqld

chkconfig mysqld on

chkconfig --list mysqld

echo pathmunge /usr/local/mysql/bin after > /etc/profile.d/mysql.sh

/etc/profile

/etc/init.d/mysqld start

service mysqld restart0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值