mysql 5.7 rpm企业版_CentOS6.6+MySQL5.7的RPM部署

1.下载安装MySQL的Yum源的rpm

[root@10-9-15-140 ~]# wget http://repo.mysql.com/mysql57-community-release-el6.rpm

[root@10-9-15-140 ~]# rpm -ivh mysql57-community-release-el6.rpm

2.查看repo文件

[root@10-9-15-140 ~]# ll /etc/yum.repos.d/

total 32

-rw-r--r-- 1 root root 89 Jun 8 19:58 10gen.repo

-rw-r--r-- 1 root root 1453 Jun 8 19:58 CentOS-Base.repo

-rw-r--r-- 1 root root 677 Jun 8 19:58 epel.repo

-rw-r--r-- 1 root root 111 Jun 8 19:58 kernel6.repo

-rw-r--r-- 1 root root 1836 Apr 27 2017 mysql-community.repo

-rw-r--r-- 1 root root 1885 Apr 27 2017 mysql-community-source.repo

-rw-r--r-- 1 root root 180 Jun 8 19:58 remi.repo

-rw-r--r-- 1 root root 671 Jun 8 19:58 rpmforge.repo

3.安装MySQL

[root@10-9-15-140 ~]# yum install -y mysql-server

[root@10-9-15-140 ~]# rpm -qa|grep mysql

mysql57-community-release-el6-11.noarch

mysql-community-client-5.7.26-1.el6.x86_64

mysql-community-libs-5.7.26-1.el6.x86_64

mysql-community-server-5.7.26-1.el6.x86_64

mysql-community-common-5.7.26-1.el6.x86_64

自动也将client包安装了,比较省事。

4.启动

[root@10-9-15-140 ~]# service mysqld start

Initializing MySQL database: [ OK ]

Starting mysqld: [ OK ]

[root@10-9-15-140 ~]# service mysqld status

mysqld (pid 12195) is running...

CentOS6.x的service mysqld start|stop|status|restart

就等价于

CentOS7.X的systemctl start|stop|status|restart mysqld

其实service ⼀次只能操作⼀个组件,

但是systemctl⼀次可以操作很多组件,

⽐如 systemctl start mysql httpd12

5.登录

查找系统默认密码(5.6版本是空密码,但是5.7系统会给⼀个初始复杂密码)

[root@10-9-15-140 ~]# cat /var/log/mysqld.log |grep password

2019-06-24T13:31:13.500735Z 1 [Note] A temporary password is generated for root@ localhost: YyvV9

[root@10-9-15-140 ~]# mysql -uroot -p'YyvV9

mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 4

Server version: 5.7.26

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值