rpm方式安装mysql5.6_rpm包方式安装mysql5.6

查看是包含和安装mysql,有的话先删除

[[email protected] opt]# rpm -qa | grep -i mysql

mysql-libs-5.1.71-1.el6.x86_64

[[email protected] opt]# yum -y remove mysql-libs*

下载mysql rpm安装包

MySQL-server-5.6.35-1.el6.x86_64.rpm

MySQL-client-5.6.35-1.el6.x86_64.rpm

MySQL-devel-5.6.35-1.el6.x86_64.rpm

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# rpm -ivh MySQL-server-5.6.35-1.el6.x86_64.rpm

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# rpm -ivh MySQL-client-5.6.35-1.el6.x86_64.rpm

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# rpm -ivh MySQL-devel-5.6.35-1.el6.x86_64.rpm

可能会出现依赖包不存在的情况 直接用yum安装即可

复制mysql配置文件

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

查看mysql初始密码

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# more /root/.mysql_secret

# The random password set for the root user at Wed Jan 18 14:32:33 2017 (local time): h7LDPJpSSXB9ErhR

启动mysql服务

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# service mysql start

用初始密码登陆mysql

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# mysql -uroot -ph7LDPJpSSXB9ErhR

修改密码为自己的密码 此处设为了root

mysql> SET PASSWORD = PASSWORD(‘root‘);

Query OK, 0 rows affected (0.00 sec)

mysql> exit

Bye

设置开机启动

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# chkconfig mysql on

[[email protected] MySQL-5.6.35-1.el6.x86_64.rpm-bundle]# chkconfig --list mysql

---史龙刚

原文:http://3126597.blog.51cto.com/3116597/1893213

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值