Linux下安装MySQL 8.0.17

yum 安装MySQL

 wget https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm
 # 安装
 rpm -Uvh mysql80-community-release-el7-3.noarch.rpm 
 # 选择版本
 yum repolist all | grep mysql

结果

mysql80-community/x86_64           MySQL 8.0 Community Server    enabled:    129

开始安装

yum -y install mysql-community-server

开始下载,自己安装

service mysqld start
service mysqld status
# 查看临时密码
grep 'temporary password' /var/log/mysqld.log
# 登录
mysql -uroot -p
# 输入刚才的密码

修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY 'root@12345';
# 新建root用户
CREATE USER 'fanl'@'%' IDENTIFIED BY 'fanl@12345';
grant all privileges on *.* to 'fanl'@'%' with grant option;
flush privileges;

出现错误

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
# 修改
mysql> set global validate_password.policy=0;

卸载删除 mysql

rpm -qa|grep -i mysql
rpm -e 搜出的包名
find / -name mysql
# 删除搜出来的路径信息

一些错误

在这里插入图片描述
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

下载慢

cd /var/cache/yum/x86_64/7/mysql80-community/packages

这是缓存,用迅雷下载后上传到此目录,执行yum update完成。

在这里插入图片描述

下载地址:http://uni.mirrors.163.com/mysql/Downloads/MySQL-8.0/

你可能感兴趣的:(数据库)