Centos6.5 源码安装MySql5.6.33

前端之家收集整理的这篇文章主要介绍了Centos6.5 源码安装MySql5.6.33前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

卸载已经安装过的旧版本MysqL

1
2
3
rpm-eMysqL
rpm-e--nodepsMysqL
yumremoveMysqL
groupaddMysqL
mkdir-pv/data/MysqLdb

useradd-r-gMysqL-d/data/MysqLdb-s/sbin/nologinMysqL


安装MysqL

安装MysqL依赖包

1
yum-y install make gcc* cmakebison-develncurses-devel

下载MysqL5.6.33

网址http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/

wgethttp: //ftp .ntu.edu.tw /MysqL/Downloads/MysqL-5 .6 /MysqL-5 .6.33. tar .gz
-zxvfMysqL-5.6.33. .gz
cd MysqL-5.6.33

编译安装

3
4
5
6
7
8
9
10
11
@H_502_127@ 12
13
14
15
16
17
cmake\
-DCMAKE_INSTALL_PREFIX= /usr/local/MysqL \
-DMysqL_DATADIR= /data/MysqLdb \
-DSYSCONFDIR= /etc \
-DWITH_MYISAM_STORAGE_ENGINE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_MEMORY_STORAGE_ENGINE=1\
-DWITH_READLINE=1\
-DMysqL_UNIX_ADDR= /var/lib/MysqL/MysqL .sock\
-DMysqL_TCP_PORT=3306\
-DENABLED_LOCAL_INFILE=1\
-DWITH_PARTITION_STORAGE_ENGINE=1\
-DEXTRA_CHARSETS=all\
-DDEFAULT_CHARSET=utf8\
-DDEFAULT_COLLATION=utf8_general_ci
&& make install

配置MysqL

4
chown -RMysqL:MysqL /usr/local/MysqL
mkdir -p /data/MysqLdb
/data
mv /etc/my .cnf .bak

初始化MysqL

2
/usr/local/MysqL
scripts /MysqL_install_db --basedir= --datadir= --user=MysqL

启动MysqL

3
cp support-files /MysqL .server /etc/init .d /MysqLd
chkconfigMysqLdon
serviceMysqLdstart

MysqL环境变量配置

PATH= /usr/local/MysqL/bin :$PATH
export PATH
source /etc/profile

设置root登录口令

2
MysqL-uroot
MysqL>SETPASSWORD=PASSWORD( '123456' );
原文链接:https://www.f2er.com/centos/380110.html

猜你在找的CentOS相关文章