centos yum install mysql8

下载安装

  1. 去官网https://dev.mysql.com/downloads/repo/yum/选择系统对应的rmp。 centos7 选择mysql80-community-release-el7-3.noarch.rpm

  2. 安装

yum -y install mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql-community-server

安装完成后,之前的MariaDB就会被覆盖掉

启动mysql

systemctl start  mysqld.service
systemctl status  mysqld.service

创建用户,添加权限

参考:https://blog.csdn.net/luguodehua/article/details/80327462

# 创建具有远程登录权限的用户
CREATE USER  'admin'@'%'  IDENTIFIED BY  'admin123456';
# 给该用户添加权限
 grant all privileges on dbname.* to admin@"%" identified by "admin123456";

你可能感兴趣的:(mysql,linux)