当前位置:网站首页>Centos7 install MySQL 8 0
Centos7 install MySQL 8 0
2022-04-23 02:47:00 【XL's Princess】
# View the installed on the current system mysql
[root@localhost ~]# rpm -qa | grep -i mysql
MySQL-test-5.6.49-1.el7.x86_64
MySQL-client-5.6.49-1.el7.x86_64
MySQL-embedded-5.6.49-1.el7.x86_64
MySQL-shared-5.6.49-1.el7.x86_64
MySQL-server-5.6.49-1.el7.x86_64
MySQL-devel-5.6.49-1.el7.x86_64
MySQL-shared-compat-5.6.49-1.el7.x86_64
# Uninstall the installation package
[root@localhost ~]# yum -y remove MySQL*
Loaded plug-in :fastestmirror
Resolving dependencies
--> Checking transactions
---> software package MySQL-client.x86_64.0.5.6.49-1.el7 Will be Delete
---> software package MySQL-devel.x86_64.0.5.6.49-1.el7 Will be Delete
---> software package MySQL-embedded.x86_64.0.5.6.49-1.el7 Will be Delete
---> software package MySQL-server.x86_64.0.5.6.49-1.el7 Will be Delete
---> software package MySQL-shared.x86_64.0.5.6.49-1.el7 Will be Delete
...............
complete !
# Delete the previous MySQL Folder
[root@localhost teach_jmp]# rm -rf my*
[root@localhost /]# find / -name mysql
/etc/selinux/targeted/active/modules/100/mysql
/var/lib/mysql
/var/lib/mysql/mysql
[root@localhost /]# rm -rf /var/lib/mysql
# Delete profile
[root@localhost lib]# rm -rf /etc/my.cnf
# Delete default password
[root@localhost lib]# rm -rf /root/.mysql_secret
# download msyq8.0 Official mirror image
[root@localhost mysql]# wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rp m
--2022-04-18 13:43:07-- http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
............
2022-04-18 13:43:25 (131 KB/s) - Saved “mysql57-community-release-el7-10.noarch.rpm” [25548/25548])
........
Downloaded: 1 files, 25K in 0.2s (131 KB/s)
# install mysql8.0 --nogpgcheck Mandatory installation ( solve :mysql-community-libs-compat-5.7.37-1.el7.x86_64.rpm The public key for has not been installed )
[root@localhost mysql]# yum install -y mysql-community-server --nogpgcheck
Loaded plug-in :fastestmirror
....... The process is omitted
complete !
# start-up MySQLd
[root@localhost mysql]# systemctl start mysqld
# Check the default root password
[root@localhost ~]# grep "A temporary password" /var/log/mysqld.log
2022-04-18T05:58:24.900384Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Xl8aVOd99)<G
# Sign in root user
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.28
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# Set up root password , Report errors : The password is not secure , Too simple
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
# Change password policy , If an error is reported, you must first set a password that conforms to the default policy , To modify the password policy .
mysql> set global validate_password.length=4;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
# Set a complex password
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Qwer@1234';
Query OK, 0 rows affected (0.01 sec)
# The password length for modifying the password policy is 4
mysql> set global validate_password.length=4;
Query OK, 0 rows affected (0.00 sec)
# The complexity level is 0,
mysql> set global validate_password.policy=0;
Query OK, 0 rows affected (0.01 sec)
# Turn off whether to check whether the user name and password are the same
mysql> set global validate_password.check_user_name=off;
Query OK, 0 rows affected (0.00 sec)
# Change Password
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '1234';
Query OK, 0 rows affected (0.00 sec)
mysql>
版权声明
本文为[XL's Princess]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220741454388.html
边栏推荐
- JVM运行时数据区(一)
- 16、 Anomaly detection
- Essential qualities of advanced programmers
- Modification du contenu de la recherche dans la boîte déroulante par PHP + MySQL
- Flink learning (XI) watermark
- Efficient music format conversion tool Music Converter Pro
- Log cutting - build a remote log collection server
- Innovation and management based on Scrum
- Flink stream processing engine system learning (II)
- OCR识别PDF文件
猜你喜欢
Linux Redis——Redis 数据库缓存服务
Innovation and management based on Scrum
Flink stream processing engine system learning (I)
Day 3 of learning rhcsa
解决win7 中powershell挖矿占用CPU100%
Deploying sbert model based on torchserve < semantic similarity task >
How big the program development of single chip microcomputer project can be, it represents your level of knocking code
Rhcsa day 1 operation
基于Torchserve部署SBERT模型<语义相似度任务>
Shell script learning notes - regular expressions
随机推荐
C language 171 Number of recent palindromes
The way to conquer C language
MySQL JDBC programming
JZ22 鏈錶中倒數最後k個結點
1、 Sequence model
Linux redis - redis ha sentinel cluster construction details & redis master-slave deployment
Water diversion into chengluo Valley p1514
Solve the problem that the registered Google email Gmail mobile number cannot be used for verification
下载正版Origin Pro 2022 教程 及 如何 激 活
Jz76 delete duplicate nodes in linked list
mysql function函数语法
Flink stream processing engine system learning (I)
Log4j知识点记录
The penultimate K nodes in jz22 linked list
[XJTU计算机网络安全与管理]第二讲 密码技术
LeetCode 1450 - 1453
Day 4 of learning rhcsa
Those years can not do math problems, using pyhon only takes 1 minute?
字符串去掉空格问题
Machine learning (Zhou Zhihua) Chapter 14 probability graph model