centos7下YUMmysql5.7安装与配置 [数据库教程]
1、环境准备:
安 装 环 境:CentOS Linux release 7.7.1908 (Core)数据库版本:mysql 5.7
2、配置yum源:
在MySQL官网中下载yum源就是rpm包地址:https://dev.mysql.com/downloads/repo/yum/ (找到对应系统版本 )
#复制mysql源连接到系统下载wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
#安装mysql源
yum localinstall mysql57-community-release-el7-8.noarch.rpm
3、修改mysql YUM源
vim /etc/yum.repos.d/mysql-community.repo将5.6和5的源enabled=0改成1 将5.7的改成0
4、开始安装mysql
yum install mysql-community-server启动mysql服务
systemctl start mysqld
添加到开机启动
systemctl enable mysqld
systemctl daemon-reload
systemctl status mysqld 查看服务运行状态是否启动
5、登陆mysql数据库
修改密码禁用临时登陆mysql_secure_installation
设置密码123456 输入两遍
或者查看临时密码
grep ‘temporary password‘ /var/log/mysqld.log
mysql -uroot -p
查看密码策略:
show variables like ‘%password%‘;
centos7下YUM mysql5.7安装与配置
以上是 centos7下YUMmysql5.7安装与配置 [数据库教程] 的全部内容, 来源链接: utcz.com/z/535102.html