当前位置:网站首页>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!
边栏推荐
- FTP protocol details
- 瀚高数据库最佳实践配置工具HG_BP日志采集内容
- Analysis of Project-based Learning Creativity in steam Education
- Thirty years of MPEG audio coding
- golang 协程的实现原理
- [QNX Hypervisor 2.2用户手册]9.11 ram(更新中)
- Li Shuo, vice president of Baidu: it's a good thing that China's labor costs rise with the support of digital technology
- 解析Steam教育中的项目式学习创造力
- 【npm错误】- npm ERR code ERESOLVE 和 npm ERR ERESOLVE could not resolve 问题
- Notes on the seventh day
猜你喜欢

架构师进阶,微服务设计与治理的 16 条常用原则

HTB-Blocky

解读AI机器人养宠引领时尚潮流

算法---粉刷房子(Kotlin)

navicat新建数据库

Li Shuo, vice president of Baidu: it's a good thing that China's labor costs rise with the support of digital technology

HTB-Blue

C language: Little Lele and hexadecimal conversion

Introduction to network foundation

融云 IM & RTC 能力上新盘点
随机推荐
第2章 VRP命令行
Etcd implementation of large-scale service governance application practice
看机器人教育引领素质教育主流
DHCP protocol detailed analysis
Cloud development pocket toolbox wechat applet source code
Summary of classic problems in Flink production environment
Stm32c8t6 encoder motor speed measurement and Arduino photoelectric module speed measurement
Jinshan cloud returns to Hong Kong for listing: Hong Kong stock rush of Chinese to B cloud manufacturers
Mysql复合查询(重要)
Deliver temperature with science and technology, vivo appears at the digital China Construction Summit
The basic concept of the origin and connotation of maker Education
Family relationship calculator wechat applet source code
Day 8 notes
PHP process communication series (I) named pipes
Available data sets for scene classification tasks (part)
[Luogu p8352] independent set of small n (DP set DP) (property)
自组织是管理者和成员的双向奔赴
The origin of Nacos' name
Weekly recommended short videos: how to make product development more effective?
My approval function of conference OA project