linux中mysql5.7安装

系统要求:

CentOS 7.6 64位


卸载系统自带mariadb-lib

1、

rpm -qa|grep mariadb

2、

rpm -e mariadb-libs-5.5.68-1.el7.x86_64  --nodeps

 


解压tar包:

tar -xvf mysql*.tar

以下加粗rpm包需要安装:
mysql-community-common-5.7.23-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm
mysql-community-minimal-debuginfo-5.7.23-1.el7.x86_64.rpm
mysql-community-server-5.7.23-1.el7.x86_64.rpm
mysql-community-devel-5.7.23-1.el7.x86_64.rpm
mysql-community-libs-5.7.23-1.el7.x86_64.rpm
mysql-community-client-5.7.23-1.el7.x86_64.rpm

mysql-community-server-minimal-5.7.23-1.el7.x86_64.rpm
mysql-community-test-5.7.23-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.23-1.el7.x86_64.rpm
mysql-community-embedded-5.7.23-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.23-1.el7.x86_64.rpm

tar包资源内容在文章最后链接获得


安装mysql:

依次执行下面的命令

1、

rpm -ivh mysql-community-common-5.7.23-1.el7.x86_64.rpm

2、

rpm -ivh mysql-community-libs-5.7.23-1.el7.x86_64.rpm

3、

rpm -ivh mysql-community-client-5.7.23-1.el7.x86_64.rpm

4、

rpm -ivh mysql-community-server-5.7.23-1.el7.x86_64.rpm

注意,如果在执行server rpm包时报错

error: Failed dependencies: libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.23-1.el7.x86_64 libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.23-1.el7.x86_64 libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.23-1.el7.x86_64

执行下面的命令然后重新执行server rpm包即可

sudo yum install numactl-libs

5、

rpm -ivh mysql-community-devel-5.7.23-1.el7.x86_64.rpm

启动mysql

systemctl start mysqld

修改密码及策略

查看初始密码

grep 'temporary password' /var/log/mysqld.log

如图中密码为 -l9qwXz.?elx

修改密码

mysql -uroot -p
#策略要求
set global validate_password_policy=0;
#密码长度
set global validate_password_length=4;
set password=password('123456');
grant all on *.* to root@'%' identified by '123456' with grant option;
flush privileges;

设置开机启动

systemctl enable mysqld
systemctl daemon-reload


链接:https://pan.baidu.com/s/1xr3pMqg4cyys0Snpr0T-Jg?pwd=taov 
提取码:taov 
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值