CentOS 6.5/6.6 安装(install)mysql 5.7 最完整版教程

前端之家收集整理的这篇文章主要介绍了CentOS 6.5/6.6 安装(install)mysql 5.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

Step8: 临时密码

5.7.10现在已经不用MysqL_secure_installation命令初始化密码了,
又保存在临时文件里:/var/log/MysqLd.log,
可以用grep 'temporary password' /var/log/MysqLd.log查找

Step9:设置外网可访问

GRANT ALL PRIVILEGES ON *.* TO root@localhost IDENTIFIED BY '1234567' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY '1234567' WITH GRANT OPTION;

flush privileges;
原文链接:https://www.f2er.com/centos/375235.html

猜你在找的CentOS相关文章