当前位置:网站首页>数据库系统原理与应用教程(005)—— yum 离线安装 MySQL5.7(Linux 环境)
数据库系统原理与应用教程(005)—— yum 离线安装 MySQL5.7(Linux 环境)
2022-07-01 16:14:00 【睿思达DBA_WGX】
数据库系统原理与应用教程(005)—— yum 离线安装 MySQL5.7(Linux 环境)
目录
一、卸载 MariaDB
[[email protected] Packages]# rpm -ivh lrzsz-0.12.20-36.el7.x86_64.rpm
警告:lrzsz-0.12.20-36.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:lrzsz-0.12.20-36.el7 ################################# [100%]
[[email protected] Packages]# yum remove -y mariadb-libs
已加载插件:fastestmirror
正在解决依赖关系
--> 正在检查事务
---> 软件包 mariadb-libs.x86_64.1.5.5.52-1.el7 将被 删除
--> 正在处理依赖关系 libmysqlclient.so.18()(64bit),它被软件包 2:postfix-2.10.1-6.el7.x86_64 需要
--> 正在处理依赖关系 libmysqlclient.so.18(libmysqlclient_18)(64bit),它被软件包 2:postfix-2.10.1-6.el7.x86_64 需要
--> 正在检查事务
---> 软件包 postfix.x86_64.2.2.10.1-6.el7 将被 删除
--> 解决依赖关系完成
依赖关系解决
===================================================================================================
Package 架构 版本 源 大小
===================================================================================================
正在删除:
mariadb-libs x86_64 1:5.5.52-1.el7 @anaconda 4.4 M
为依赖而移除:
postfix x86_64 2:2.10.1-6.el7 @anaconda 12 M
事务概要
====================================================================================================
移除 1 软件包 (+1 依赖软件包)
安装大小:17 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
警告:RPM 数据库已被非 yum 程序修改。
正在删除 : 2:postfix-2.10.1-6.el7.x86_64 1/2
正在删除 : 1:mariadb-libs-5.5.52-1.el7.x86_64 2/2
验证中 : 2:postfix-2.10.1-6.el7.x86_64 1/2
验证中 : 1:mariadb-libs-5.5.52-1.el7.x86_64 2/2
删除:
mariadb-libs.x86_64 1:5.5.52-1.el7
作为依赖被删除:
postfix.x86_64 2:2.10.1-6.el7
完毕!
二、把所需的 rpm 包上传到服务器
[[email protected] mysql-soft]# pwd
/soft/mysql-soft
[[email protected] mysql-soft]# rz
[[email protected] mysql-soft]# ll
总用量 196704
-rw-r--r--. 1 root root 25365436 6月 12 2019 mysql-community-client-5.7.27-1.el7.x86_64.rpm
-rw-r--r--. 1 root root 281248 6月 12 2019 mysql-community-common-5.7.27-1.el7.x86_64.rpm
-rw-r--r--. 1 root root 2272032 6月 12 2019 mysql-community-libs-5.7.27-1.el7.x86_64.rpm
-rw-r--r--. 1 root root 173500088 6月 12 2019 mysql-community-server-5.7.27-1.el7.x86_64.rpm
三、安装 rpm 包
[[email protected] mysql-soft]# rpm -ivh --nodeps --force *.rpm
警告:mysql-community-client-5.7.27-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:mysql-community-common-5.7.27-1.e################################# [ 25%]
2:mysql-community-libs-5.7.27-1.el7################################# [ 50%]
3:mysql-community-client-5.7.27-1.e################################# [ 75%]
4:mysql-community-server-5.7.27-1.e################################# [100%]
四、配置 MySQL 操作环境
1、启动 MySQL 服务
[[email protected] mysql-soft]# systemctl restart mysqld
2、查看 MySQL 相关的文件与目录
[[email protected] mysql-soft]# find / -name mysql*
/etc/selinux/targeted/active/modules/100/mysql
/etc/logrotate.d/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/bin/mysql
/usr/lib64/mysql
/usr/share/mysql
# MySQL 的配置文件
[[email protected] mysql-soft]# ll /etc/my.cnf
-rw-r--r--. 1 root root 960 6月 10 2019 /etc/my.cnf
# MySQL 的日志文件
[[email protected] mysql-soft]# ll /var/log/mysqld.log
-rw-r-----. 1 mysql mysql 3795 6月 26 19:14 /var/log/mysqld.log
# MySQL 的启动脚本
[[email protected] mysql-soft]# ll /usr/lib/systemd/system/mysqld.service
-rw-r--r--. 1 root root 1614 6月 10 2019 /usr/lib/systemd/system/mysqld.service
# MySQL 的进程文件
[[email protected] mysql-soft]# ll /var/run/mysqld/mysqld.pid
-rw-r-----. 1 mysql mysql 5 6月 26 19:14 /var/run/mysqld/mysqld.pid
# socket 文件
[[email protected] mysql-soft]# ll /var/lib/mysql/mysql.sock
srwxrwxrwx. 1 mysql mysql 0 6月 26 19:14 /var/lib/mysql/mysql.sock
3、查看 MySQL 默认的 root 账户密码
MySQL 安装完成之后,会为 root 账户 生成一个默认密码。通过下面的方式可以查看默认密码。
[[email protected] mysql-soft]# grep 'temporary password' /var/log/mysqld.log
2022-06-26T11:14:04.385266Z 1 [Note] A temporary password is generated for [email protected]: QFh7LiP8-r#c
4、使用默认密码登录 MySQL
[roo[email protected] mysql-soft]# mysql -uroot -pQFh7LiP8-r#c
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27
Copyright (c) 2000, 2019, 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>
5、修改 root 账号的密码
mysql> alter user 'root'@'localhost' identified by 'Wgx123456.';
Query OK, 0 rows affected (0.00 sec)
6、使用新密码登录 MySQL
[[email protected] mysql-soft]# mysql -uroot -pWgx123456.
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, 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>
边栏推荐
- Zhou Shaojian, rare
- 揭秘慕思“智商税”:狂砸40亿搞营销,发明专利仅7项
- ABAP call restful API
- process.env.NODE_ENV
- 数据库系统原理与应用教程(004)—— MySQL 安装与配置:重置 MySQL 登录密码(windows 环境)
- 虚拟串口模拟器和串口调试助手使用教程「建议收藏」
- 广东用电量大跌,说明高新技术产业替代高能耗产业已取得初步成果
- Summer Challenge harmonyos canvas realize clock
- PostgreSQL 存储结构浅析
- Where should older test / development programmers go? Will it be abandoned by the times?
猜你喜欢
[nodemon] app crashed - waiting for file changes before starting...解决方法
AVL balanced binary search tree
process. env. NODE_ ENV
What is the digital transformation of manufacturing industry
SQLServer查询: a.id与b.id相同时,a.id对应的a.p在b.id对应的b.p里找不到的话,就显示出这个a.id和a.p
德国iF多项大奖加冕,这副耳机有多强?音珀GTW 270 Hybrid深度评测
數據庫系統原理與應用教程(006)—— 編譯安裝 MySQL5.7(Linux 環境)
【LeetCode】43. 字符串相乘
基于PHP的轻量企业销售管理系统
IM即时通讯开发实现心跳保活遇到的问题
随机推荐
China's intelligent transportation construction from the perspective of "one hour life circle" in Dawan District
Can't global transactions be used when shardingjdbc is used in seate?
2022 Moonriver global hacker song winning project list
ABAP call restful API
Tutorial on principles and applications of database system (004) -- MySQL installation and configuration: resetting MySQL login password (Windows Environment)
瑞典公布决定排除华为5G设备,但是华为已成功找到新出路
The picgo shortcut is amazing. This person thinks exactly the same as me
数据库系统原理与应用教程(004)—— MySQL 安装与配置:重置 MySQL 登录密码(windows 环境)
Preliminary study on golang crawler framework
【Hot100】17. Letter combination of telephone number
Tutorial on principles and applications of database system (006) -- compiling and installing MySQL 5.7 (Linux Environment)
IM即时通讯开发万人群聊消息投递方案
[daily news]what happened to the corresponding author of latex
In the past six months, it has been invested by five "giants", and this intelligent driving "dark horse" is sought after by capital
Principes et applications du système de base de données (006) - - compilation et installation de MySQL 5.7 (environnement Linux)
Principle of motion capture system
[PHP graduation design] design and implementation of textbook management system based on php+mysql+apache (graduation thesis + program source code) -- textbook management system
There is a difference between u-standard contract and currency standard contract. Will u-standard contract explode
Origin2018安装与使用(整理中)
基于PHP的轻量企业销售管理系统