centos8安装mysql5.5_2020.5.23 centos8 安装mysql 5.7

1.wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm --no-check-certificate  获取rpm 包

2. mv mysql-community-release-el6-5.noarch.rpm /home/liujun/  将包移动到某个目录下

3.yum localinstall mysql-community-release-el6-5.noarch.rpm

4. yum repolist all | grep mysql 查看安装的依赖

5. /etc/yum.repos.d/mysql-community.repo 的设置如下,注意最后一栏 [mysql57-community-dmr]

[mysql-connectors-community]

name=MySQL Connectors Community

baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/6/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

[mysql-tools-community]

name=MySQL Tools Community

baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/6/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.5

[mysql55-community]

name=MySQL 5.5 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/

enabled=0

gpgcheck=1

gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.6

[mysql56-community]

name=MySQL 5.6 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/

enabled=0

gpgcheck=1

gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Note: MySQL 5.7 is currently in development. For use at your own risk.

# Please read with sub pages: https://dev.mysql.com/doc/relnotes/mysql/5.7/en/

[mysql57-community-dmr]

name=MySQL 5.7 Community Server Development Milestone Release

baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/

enabled=1

gpgcheck=0

gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

6.sudo yum install mysql-server

修改密码:

在 /etc/my.cnf 后面加 skip-grant-tables  免密登录

1.systemctl restart mysqld  重启服务

2.mysql -u root -p 输入密码时直接按Enter键登录

3.update mysql.user set authentication_string=password('xxx') where user='root' and host='localhost';  xxx 改为自己密码

4.flush privileges 刷新

5.skip-grant-tables

6.systemctl restart mysqld 再重启

命令:

1. rpm -qa | grep -i mysql 查询mysql 安装的依赖

2.yum install mysql-devel  安装后有mysql 文件夹

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值