centos7.*系统下yum安装mysql8
1.安装资源库
yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
2. 安装mysql服务
yum install mysql-community-server -y
如果出现“GPG密钥已安装,但是不适用于此软件包的问题”
处理办法
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
3、设置大小写不敏感
vi my.cnf文件,设置 lower_case_table_names = 1 ,重启mysql后生效
-
vi my.cnf
#添加
-
lower_case_table_names = 1
4. mysql服务管理
-
# 启动
-
systemctl start mysqld
-
# 停止
-
systemctl stop mysqld
-
# 重启
-
systemctl restart mysqld
-
# 开机启动
-
systemctl enable mysqld
5. 设置远程连接
5.1 修改root用户远程登录
-
update mysql.user set host='%' where user="root";
-
flush privileges;