mysql5.7安装

下载:
https://downloads.mysql.com/archives/community/

下载包
https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.29-1.el7.x86_64.rpm-bundle.tar

1. rpm安装

c 复制代码
[root@test mysql57]# rpm -ivh --force *.rpm --replacefiles
warning: mysql-community-client-5.7.29-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-common-5.7.29-1.e################################# [ 14%]
   2:mysql-community-libs-5.7.29-1.el7################################# [ 29%]
   3:mysql-community-client-5.7.29-1.e################################# [ 43%]
   4:libaio-0.3.109-13.el7            ################################# [ 57%]
   5:mysql-community-server-5.7.29-1.e################################# [ 71%]
   6:mysql-community-devel-5.7.29-1.el################################# [ 86%]
   7:mysql-community-libs-compat-5.7.2################################# [100%]

2. 修改密码

刚安装完数据库,数据库启动后初识密码在 /var/log/mysqld.log

c 复制代码
如:2020-09-15T21:01:00.138133Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2020-09-15T21:01:05.062976Z 0 [Warning] CA certificate ca.pem is self signed.
2020-09-15T21:01:07.027963Z 1 [Note] A temporary password is generated for root@localhost: V-2Cw>rNs5+I
2020-09-15T21:01:11.277068Z 0 [Warning] Changed limits: max_open_files: 5000 (requested 5120)
2020-09-15T21:01:11.278003Z 0 [Warning] Changed limits: table_open_cache: 1983 (requested 2000)
2020-09-15T21:01:11.657744Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.

3. 登录进去后,需要先修改密码

c 复制代码
[root@test ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.29

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

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.

mysql> 
mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> 

开始修改密码:
mysql> 
mysql> alter user 'root'@'localhost' identified by 'SiHai_2019';
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql>
相关推荐
未来会更好yes4 小时前
Centos 7.6安装redis-6.2.6
linux·redis·centos
二猛子4 小时前
Linux(Centos版本)中安装Docker
linux·docker·centos
老友@5 小时前
小集合 VS 大集合:MySQL 去重计数性能优化
数据库·mysql·性能优化
麦麦大数据6 小时前
vue+neo4j+flask 音乐知识图谱推荐系统
vue.js·mysql·flask·知识图谱·neo4j·推荐算法·音乐推荐
爱吃烤鸡翅的酸菜鱼8 小时前
【SpringMVC】概念引入与连接
java·开发语言·mysql
小白考证进阶中9 小时前
0基础可以考MySQL OCP么?备考时间需要多久?
数据库·mysql·开闭原则
努力奋斗的小杨9 小时前
学习MySQL的第十二天
数据库·笔记·学习·mysql·navicat
苹果酱056710 小时前
【Azure Redis 缓存】在Azure Redis中,如何限制只允许Azure App Service访问?
java·vue.js·spring boot·mysql·课程设计
tcoding10 小时前
《MySQL 技术内幕-innoDB 存储引擎》笔记
数据库·笔记·mysql
蓝易云10 小时前
在Linux、CentOS7中设置shell脚本开机自启动服务
前端·后端·centos