Skip to content

MySQL知识体系

Centos7安装与配置MySQL

MariaDB的安装与配置

yum install mariadb.x86_64 mariadb-server.x86_64 mariadb-devel.x86_64 -y
systemctl enable mariadb.service
systemctl start mariadb.service

# 初始化配置
mysql_secure_installation

MySQL的安装与配置

# 下载源
wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm

# 如果太慢就用中科大的源
wget http://mirrors.ustc.edu.cn/mysql-repo/mysql80-community-release-el7.rpm

# 安装源
rpm -ivh mysql80-community-release-el7-3.noarch.rpm 

# 安装数据库
yum install mysql-community-server.x86_64 -y

# 启动服务
systemctl start mysqld.service

# 查看数据库初始密码
grep "password" /var/log/mysqld.log

# 修改数据库密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'BloodZero@0';