当前位置:网站首页>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 class loader
- JVM runtime data area (I)
- JZ22 链表中倒数最后k个结点
- JZ35 replication of complex linked list
- Leangoo brain map - shared multi person collaborative mind mapping tool
- 工业互联网+危化安全生产综合管理平台怎样建
- Implementation of distributed scenario business operation log (based on redis lightweight)
- Slave should be able to synchronize with the master in tests/integration/replication-psync.tcl
- Day 4 of learning rhcsa
- php+mysql對下拉框搜索的內容修改
猜你喜欢

JVM class loader

Hack the box optimum

国产轻量级看板式Scrum敏捷项目管理工具

谷雨

Linux Redis——Redis 数据库缓存服务

基于多态的职工管理系统源码与一些理解

Renesas electronic MCU RT thread development and Design Competition

grain rain

Slave should be able to synchronize with the master in tests/integration/replication-psync.tcl

How can enterprises with major hazard installations ensure the completion of the digital construction task of double prevention mechanism by the end of the year
随机推荐
MySQL / SQL Server判断表或临时表存在则删除
Practice of industrial defect detection project (III) -- Based on FPN_ PCB defect detection of tensorflow
Mosaic Routing: implement / home / news
Jz76 delete duplicate nodes in linked list
What is the difference between varchar and char?
Difference between relative path and absolute path (often asked in interview)
MySQL复杂查询使用临时表/with as(类似表变量)
国产轻量级看板式Scrum敏捷项目管理工具
Android high-level interview must ask: overall business and project architecture design and reconstruction
[XJTU计算机网络安全与管理]第二讲 密码技术
基于多态的职工管理系统源码与一些理解
JVM class loader
Cuisine leetcode
ROP Emporium x86_64 7~8题
Planning code ROS migration POMDP prediction planning (I)
Actual combat of industrial defect detection project (IV) -- ceramic defect detection based on hrnet
Day 4 of learning rhcsa
Devil cold rice 𞓜 078 devil answers the market in Shanghai and Nanjing; Communication and guidance; Winning the country and killing and screening; The purpose of making money; Change other people's op
1、 Sequence model
Yes, from today on, our fans can participate in Netease data analysis training camp for free!