当前位置:网站首页>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!
边栏推荐
- A good-looking IAPP donation list source code
- 扫雷简单版
- Comic algorithm_ Xiaohuihui interview
- Chapter 09_ Use of performance analysis tools
- 【luogu P8352】小 N 的独立集(DP套DP)(性质)
- MySql的安装配置超详细教程与简单的建库建表方法
- 04 | 后台登录:基于账号密码的登录方式(上)
- The basic concept of the origin and connotation of maker Education
- 看机器人教育引领素质教育主流
- 并发模式之单例和不变模式
猜你喜欢

MySQL - the difference between count (field), count (primary key), count (1), count (*)

C语言:小乐乐与欧几里得

Source code of Jiugongge heart puzzle Applet / source code of main wechat applet with traffic

STP protocol (spanning tree protocol)

Some new ideas about time complexity

Mongodb index (3)

区区区间---线段树lazy标记板子题

Chapter 09_ Use of performance analysis tools

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

Cloud development pocket toolbox wechat applet source code
随机推荐
Day 5 experiment
Flink kernel source code (VII) Flink SQL submission process
[Luogu p8352] independent set of small n (DP set DP) (property)
12.书写规则-静态模式
Zone --- line segment tree lazy marking board sub problem
盘点国内外项目协同管理软件:SaaS和定制化成趋势
sqlilabs less-32~less-33
向DataFrame中的特定位置添加一行
Analysis of OWT server source code (III) -- video module analysis of mixer in
冰冰学习笔记:运算符重载---日期类的实现
PHP process communication series (I) named pipes
FTP协议详解
Plug in --- line segment sloth marking board + simple mathematical reasoning
Available data sets for scene classification tasks (part)
PHP lucky draw system with background source code
OWT server source code analysis (4) -- video module analysis of mixer out
Thirty years of MPEG audio coding
C语言程序设计 | 交换二进制数奇偶位(宏实现)
明明开发薪资高,为什么我还是选了测试?
《QA离业务代码能有多近?》QA对业务代码进行可测性改造