栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Linux Redhat8 安装MySQL8图文详解-yum

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Linux Redhat8 安装MySQL8图文详解-yum

梦想太容易实现就不是梦想了,但没有梦想,现实就是一片漆黑。

准备

查看是否安装过MySQL,如果有则需要卸载掉原有的服务。

(32条消息) Linux Redhat8 卸载MySQL8_成长20171221的博客-CSDN博客https://blog.csdn.net/qq_37976289/article/details/124594169

第一步:安装MySQL8.0

yum install @mysql:8.0 -y

1.Failed to set locale, defaulting to C.UTF-8

原因是因为没有配置正确的语言环境造成的。将该配置文件进行就该即可。

echo "export LC_ALL=en_US.UTF8" >> /etc/profile

source /etc/profile

2.this system is not registered with an entitlement server.

系统没有注册,使用yum时会提醒你注册,不注册这个功能不能使用。

注册地址:

注册 | Red Hat IDPhttps://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/registrations?client_id=rhd-web&redirect_uri=https%3A%2F%2Fdevelopers.redhat.com%2Fconfirmation&state=4c101613-9935-451c-8127-a7a0c5dba24d&response_mode=fragment&response_type=code&scope=openid&nonce=9046f8c9-fc39-46c7-846c-a562d0b06245账号注册成功后,在系统中使用命令注册

subscription-manager register --username yourname --password yourpassword --auto-attach

安装成功

redhat8通过yum安装mysql8后的配置文件是通过/etc/my.cnf调用的/etc/my.cnf.d/目录,其中的mysql-server.cnf为主配置文件,mysql-default-authentication-plugin.cnf为身份验证文件

mysql-server.cnf初始参数:

[mysqld]
datadir=/var/lib/mysql                            #数据目录
socket=/var/lib/mysql/mysql.sock                  #socket
log-error=/var/log/mysql/mysqld.log               #日志文件
pid-file=/run/mysqld/mysqld.pid                   #pid文件

第二步:启动MySQL服务并设置开启启动

systemctl start mysqld

systemctl enable mysqld

第三步:安全初始化,设置root密码和进行安全设置

mysql_secure_installation

也可以空密码进入,直接进行密码修改

mysql -u root -p; #确认密码时直接回车

use mysql;

alter user 'root'@'localhost' identified with mysql_native_password by '密码`;

第四步:验证安装是否成功

mysql -u root -p;

select version();

第五步:创建用户

create user 'admin'@'%' identified by 'Hm5$uPLfat%jCNXc';

grant all on *.* to 'admin'@'%';

 第六步:远程连接

1.2003:can not connect to MySQL server on '192.168.0.179'

问题:没有关闭防火墙

方法:直接关闭防火墙

systemctl stop firewalld;    #重启后失效

systemctl disabled firewalld;   #永久性

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/859304.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号