Mysql5.5编译方式安装实战

1.安装前准备工作
[root@backup_server ~]# uname -r
2.6.32-431.el6.x86_64
[root@backup_server ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
tar zxf mysql-5.5.32.tar.gz
tar cmake-2.8.8.tar.gz
tar zxf cmake-2.8.8.tar.gz
cd cmake-2.8.8
./configure
gmake
gmake install
yum install ncurses-devel -y
useradd mysql -M -s /sbin/nologin

2.cmake安装mysql
cd mysql-5.5.32
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.5.32 \
-DMYSQL_DATADIR=/usr/local/mysql-5.5.32/data \
-DMYSQL_UNIX_ADDR=/usr/local/mysql-5.5.32/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1\
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DWITH_DEBUG=0
make && make install

3.安装后配置

ln -s /usr/local/mysql-5.5.32 /usr/local/mysql
选择配置文件
\cp mysql-5.5.32/support-files/my-small.cnf /etc/my.cnf
配置环境变量
echo 'export PATH=/usr/local/mysql/bin/:$PATH' >> /etc/profile
tail -1 /etc/profile
source /etc/profile
echo $PATH
初始化数据库
chown -R mysql.mysql /usr/local/mysql/data/
chmod -R 1777 /tmp/
cd /usr/local/mysql/scripts/
./mysql_install_db --basedir=/usr/local/mysql-5.5.32/ --datadir=/usr/local/mysql-5.5.32/data/ --user=mysql
cp ../support-files/mysql.server /etc/init.d/mysqld
chmod u+x /etc/init.d/mysqld
service mysqld start
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值