CentOS7.5 安装Mysql5.7

因为Mysql被Oracle收购的原因,在Centos7开始,默认的数据库由MariaDB取代Mysql

开始

安装mysqlclient

yum install gcc mariadb-devel 
pip3 install mysqlclient

安装Mysql

 wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
 yum -y install mysql57-community-release-el7-10.noarch.rpm
  yum -y install mysql-community-server
  systemctl start  mysqld.service
  systemctl status mysqld.service

CentOS7.5 安装Mysql5.7_第1张图片
查看密码

grep "password" /var/log/mysqld.log

在这里插入图片描述
修改密码

set global validate_password_policy=0;
set global validate_password_length=1;
 ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';

但此时还有一个问题,就是因为安装了Yum Repository,以后每次yum操作都会自动更新,需要把这个卸载掉:

yum -y remove mysql57-community-release-el7-10.noarch

你可能感兴趣的:(Python,后端)