卸载已经安装过的旧版本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
12
13
14
15
16
17
|
cmake\
-DSYSCONFDIR=
/etc
\
-DWITH_MYISAM_STORAGE_ENGINE=1\
-DWITH_INNOBASE_STORAGE_ENGINE=1\
-DWITH_MEMORY_STORAGE_ENGINE=1\
-DWITH_READLINE=1\
-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 |
/data
mv
/etc/my
.cnf
.bak
|
初始化MysqL
2 |
/usr/local/MysqL
|
启动MysqL
3 |
chkconfigMysqLdon
serviceMysqLdstart
|
MysqL环境变量配置
PATH=
/usr/local/MysqL/bin
:$PATH
export
PATH
source
/etc/profile
|
设置root登录口令
2 |
MysqL-uroot
|