本文探讨在CentOS 7.4上用yum方式来安装和配置MysqL 5.6。全文如下。
1. 清理CentOS7下的MariaDB
CentOS 7中自带了MariaDB,把它给卸载掉。
# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
# rpm -e --nodepsmariadb-libs-5.5.56-2.el7.x86_64
2. download MysqL 的yum包
# wgethttp://dev.MysqL.com/get/MysqL-community-release-el7-5.noarch.rpm
#rpm-ivhMysqL-community-release-el7-5.noarch.rpm
# yum repolist enabled | grep "MysqL.*-community.*"
Repository epel is listed more than once in the configuration
MysqL-connectors-community/x86_64 MysqL Connectors Community 42
MysqL-tools-community/x86_64 MysqL Tools Community 55
MysqL56-community/x86_64 MysqL 5.6 Community Server 361
3. 安装MysqL 5.6
#yuminstallMysqL-community-server
....
安装过程中会提示依赖安装,选择Y就可以了。
4. MysqL启动
systemctl enable MysqLd.service
systemctl start MysqLd
systemctl status MysqLd
5.MysqL 安全配置
#MysqL_secure_installation
6. 其它安装(可选的)
安装 MysqL Workbench工具
yum install MysqL-workbench-community
7.定制化MysqL
yum装的MysqL在一些情况下,不能安装我们实际的要求。故需要定制化。MysqL的配置文件是/etc/my.cnf
1) MysqL服务性能优化—my.cnf配置说明详解(16G内存)
http://www.jb51.cc/article/p-tatbcrrv-bmg.html
官方安装参考文档如下:
https://dev.mysql.com/doc/refman/5.6/en/linux-installation-yum-repo.html
原文链接:https://www.f2er.com/centos/374965.html