当前位置:网站首页>CentOS install mysql8
CentOS install mysql8
2022-07-29 02:58:00 【m0_ sixty-seven million four hundred and three thousand one hun】
1. Download and install yum repostory
download :
wget -i -c https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
install myql:
yum -y install mysql80-community-release-el7-1.noarch.rpm
install mysql service :
yum -y install mysql-community-server
2. Configuration database :
2.1 If necessary, you can set u Case insensitive ( edit /etc/my.cnf file ):
Add the following configuration to the file :
lower_case_table_names=1 // 1: Insensitivity ,0: sensitive )
2.2 start-up mysql8
systemctl start mysqld.service
2.3 see mysql8 Running state
systemctl status mysqld.service
2.4 Set the password
We need to know the password first root Use the following command to view the initial password of the account :
grep "password" /var/log/mysqld.log

The arrow in the above figure indicates the initial password , Copy the password , Use the following command to log in to the database :
mysql -uroot -p
Be careful : At this time, you can't do anything by logging in with your initial password , You need to change the initial password first , Modify the initial password. If the password is too simple, it will report an error , If you want to set a simple password , Then for the first time, you'd better set a more complicated , Modify the password policy after setting , At this time, you can change it to a simple password again , The specific operation is as follows :
2.4.1 Change a complex password :
ALTER USER 'root'@'localhost' IDENTIFIED BY ' Your complex password ';
2.4.2 Check password policy :
SHOW VARIABLES LIKE 'validate_password%';

Note that there mysql8 The password policy for is
validate_password.policy
and mysql5 The password policy is
validate_password_policy
2.4.3 Modify the policy to low level :
set global validate_password.policy=LOW;
And then follow 2.4.1 Command to change a simple password
3. Set up remote access :
3.1 Open the firewall 3306 port
firewall-cmd --permanent --zone=public --add-port=3306/tcp
If the firewall is off , You can open it first
1> View firewall status :systemctl status firewalld
2> Turn on the firewall :systemctl start firewalld
After opening the firewall, execute the open port command .
3.2 Refresh firewall
firewall-cmd --reload
End of installation .
** Last :** If you use navicat The client login may report an error , Because the password authentication method does not support , The default is caching_sha2_password, You can modify /etc/my.cnf The password authentication method of the file is changed to mysql_native_password
stay my.cnf Of documents [mysqld] Add the following configuration :
default_authentication_plugin=mysql_native_password
Sign in mysql
mysql -u root -p
Query user information :
select host, user, authentication_string, plugin from user;

We can see relevant information in the above figure , Default localhost, Does not support all ip visit , We modify all ip All allowed , Then put localhost Change it to %
update user set host='%' where user = 'root';
Modify encryption rules :
ALTER USER 'root'@'%' IDENTIFIED BY ' The login password ' PASSWORD EXPIRE NEVER;
Update the password :
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY ' The login password ';
Refresh the permissions :
flush privileges;
Here we are ok!
边栏推荐
- C#从网址异步获得json格式的数据
- 《QA离业务代码能有多近?》通过codediff直接暴露缺陷
- 混淆矩阵学习笔记
- 解析Steam教育中的项目式学习创造力
- 【npm错误】- npm ERR code ERESOLVE 和 npm ERR ERESOLVE could not resolve 问题
- MySql的安装配置超详细教程与简单的建库建表方法
- 《QA离业务代码能有多近?》QA对业务代码进行可测性改造
- Interpreting AI robots' pet raising and leading fashion trends
- 04 | 后台登录:基于账号密码的登录方式(上)
- (作业)C语言:atoi和strncpy、strncat、strncmp的模拟实现
猜你喜欢

JVM基础入门篇一(内存结构)

混淆矩阵学习笔记

Etcd implementation of large-scale service governance application practice

STP协议(生成树协议)

Cloud development workers must go to work fishing and paddling wechat applet source code

Some new ideas about time complexity

MySql的安装配置超详细教程与简单的建库建表方法

工科男生:20岁未满,平凡但不平庸

Family relationship calculator wechat applet source code

idea配置web容器与war打包
随机推荐
Thirty years of MPEG audio coding
MongoDB索引 (3)
centos安装mysql8
创客教育的起源和内涵的基本理念
A good-looking IAPP donation list source code
三子棋(玩家+电脑)
R语言ERROR: compilation failed for package ‘****‘
Pytest environment deployment + use case execution management + use case parameterization
Analysis of concepts and terms in data warehouse
解析机器人与人类情感共鸣的主观意识
Rocbos open source micro community light forum source code
爆肝整理JVM十大模块知识点总结,不信你还不懂
并发模式之异步回调Future模式
会议OA项目之我的审批功能
Comic algorithm_ Xiaohuihui interview
vasp计算任务报错:M_divide:can not subdivide 8 nodes by 6
Advanced architects, 16 common principles of microservice design and Governance
金山云回港上市:中国TO B云厂商的港股奔袭
Look at robot education and lead the mainstream of quality education
数仓中概念术语解析