CentOS7.0 下利用rpm 安装Mysql5.6

Step1 将rpm包下载到本地

需要下载两个包:用于提供服务的server和用于客户端展示的client.

cd /user/tools
wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm
wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm

Step2 安装rpm包

rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm

Step3 启动mysql

systemctl start mysql

Step4 登录mysql

查看mysql初始密码

cd
cat .mysql_secret

登录mysql,执行命令后输入.mysql_secret中的密码

mysql -uroot -p

Step5 修改Mysql密码

SET PASSWORD = PASSWORD('geekzhou.com');
    原文作者:geekzhou
    原文地址: https://segmentfault.com/a/1190000008321262
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞