1 下载MySQL的YUM仓库
wget https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
2 安装下载的MySQL的YUM仓库
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
执行完成后会在/etc/yum.repos.d/目录下生成两个repo文件 mysql-community.repo mysql-community-source.repo
3 修改Centos8 YUM源
# 进入yum的repos目录
cd /etc/yum.repos.d/
# 修改所有的CentOS文件内容
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
# 更新yum源为阿里镜像
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
yum clean all
yum makecache
4 安装MySQL服务器
yum install mysql-server
选择 y
5 设置不区分大小写
vim /etc/my.cnf
在[mysqld]下,添加以下内容
#让MYSQL大小写敏感(1-不敏感,0-敏感)
lower_case_table_names=1
6 启动MySQL
systemctl start mysqld.service
7 查看MySQL运行状态
systemctl status mysqld.service
8 登录MySQL
此时MySQL已经开始正常运行,并且不需要密码
mysql -uroot
9 设置远程访问
use nysql;
select user, host from user;
update user set host='%' where user = 'root';
flush privileges;
10 dbeaver 链接 mysql
填写服务器地址、端口、用户名、密码、点击测试连接
11 停止mysql
systemctl stop mysqld.service