Centos7 yum安装MySQL8

Centos7 yum安装MySQL8

  • 安装MySQL
    • 配置MySQL

安装MySQL

官网链接:MySQL yum repository
Centos7 yum安装MySQL8_第1张图片
下载 MySQL:
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
安装MySQL:
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
yum install mysql-community-server

配置MySQL

  • 启动MySQL服务
    sudo systemctl start mysqld
  • 开机启动
    systemctl enable mysqld
  • 查看运行状态
    sudo systemctl status mysqld
  • 获取初始密码
    grep 'temporary password' /var/log/mysqld.log
  • 登陆并个改初始密码
mysql -uroot -p`
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your password';
  • 开启远程连接
update user set host='%' where user='root';
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your password';

你可能感兴趣的:(Linux)