# yum list installed | grep 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;