共计 897 个字符,预计需要花费 3 分钟才能阅读完成。
CentOS 通过 yum 在线安装 MySQL5.7
Step1: 检测系统是否自带安装 mysql
# yum list installed | grep mysql
Step2: 删除系统自带的 mysql 及其依赖
命令:
# yum -y remove mysql-libs.x86_64
Step3: 给 CentOS 添加 rpm 源,并且选择较新的源
命令:
# wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
# yum localinstall mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
# yum-config-manager --disable mysql55-community
# yum-config-manager --disable mysql56-community
# yum-config-manager --enable mysql57-community-dmr
# yum repolist enabled | grep mysql
Step4: 安装 mysql 服务器
命令:
# yum install mysql-community-server
Step5: 启动 mysql
命令:
# service mysqld start
Step6: 查看 mysql 是否自启动, 并且设置开启自启动
命令:
# chkconfig --list | grep mysqld
# chkconfig mysqld on
Step7: mysql 安全设置
命令:
# mysql_secure_installation
参考相关文档地址:
http://www.rackspace.com/knowledge_center/article/installing-mysql-server-on-centos
http://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-10/136523.htm
正文完
星哥玩云-微信公众号