centos 离线安装mysql_CentOS6离线安装mysql-5.7.25

1.mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar下载百度云资源

提取码:ej1y

2.把下载的mysql安装包上传到Centos上

解压mysql,我这是在Windows上解压的上传到Centos上,我在Centos上解压mysql不知道为什么少了rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm包

tar –xvf mysql-5.7.25-1.el6.x86_64.rpm-bundle.tar

fb6fc1498995780b59414bfeb59c767e.png

3.查看mysql依赖

rpm -qa | grep mysql

4.如果查看有mysql依赖,就删除mysql依赖,

rpm -e --nodeps `rpm -qa | grep mysql`

5.再次查是否有mysql依赖

rpm -qa | grep mysql

6.安装一定要按照顺序来

第一个安装:  rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm报了一个错误

[root@localhost mysql-5.7.25]# rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

warning: mysql-community-common-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ########################################### [100%]

file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/armscii8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/ascii.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp1250.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp1251.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp1256.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp1257.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp850.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp852.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/cp866.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/dec8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/geostd8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/greek.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/hebrew.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/hp8.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/keybcs2.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/koi8r.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/koi8u.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/latin1.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/latin2.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/latin5.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/latin7.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/macce.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/macroman.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

file /usr/share/mysql/charsets/swe7.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

[root@localhost mysql-5.7.25]# file /usr/share/mysql/charsets/Index.xml from install of mysql-community-common-5.7.25-1.el6.x86_64 conflicts with file from package MariaDB-common-10.4.8-1.el7.centos.x86_64

/usr/share/mysql/charsets/Index.xml: XML document text

from: cannot open `from' (No such file or directory)

install: cannot open `install' (No such file or directory)

of: cannot open `of' (No such file or directory)

mysql-community-common-5.7.25-1.el6.x86_64: cannot open `mysql-community-common-5.7.25-1.el6.x86_64' (No such file or directory)

conflicts: cannot open `conflicts' (No such file or directory)

with: cannot open `with' (No such file or directory)

file: cannot open `file' (No such file or directory)

from: cannot open `from' (No such file or directory)

package: cannot open `package' (No such file or directory)

MariaDB-common-10.4.8-1.el7.centos.x86_64: cannot open `MariaDB-common-10.4.8-1.el7.centos.x86_64' (No such file or directory)

原因:已存在MariaDB-common-10.4.8-1.el7.centos.x86_64的库(这是我以前安装MariaDB数据库,如果是别的也要根据对应的名字删除),所以需要先删除以前的库才能安装!

执行强制卸载命令:

rpm -e MariaDB-common-10.4.8-1.el7.centos.x86_64--nodeps

然后查看:

rpm –qa | grep mysql

再继续安装

rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

[root@localhost mysql-5.7.25]# rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm

warning: mysql-community-common-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ########################################### [100%]

1:mysql-community-common ########################################### [100%]

第二个安装:

rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm

[root@localhost mysql-5.7.25]# rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm

warning: mysql-community-libs-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ########################################### [100%]

1:mysql-community-libs ########################################### [100%]

第三个安装

rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm

[root@localhost mysql-5.7.25]# rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm

warning: mysql-community-client-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ########################################### [100%]

1:mysql-community-client ########################################### [100%]

第四个安装

rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm

[root@localhost mysql-5.7.25]# rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm

warning: mysql-community-server-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ########################################### [100%]

1:mysql-community-server ########################################### [100%]

You have new mail in /var/spool/mail/root

第五个安装

rpm -ivh mysql-community-devel-5.7.25-1.el6.x86_64.rpm

[root@localhost mysql-5.7.25]# rpm -ivh mysql-community-devel-5.7.25-1.el6.x86_64.rpm

warning: mysql-community-devel-5.7.25-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing... ########################################### [100%]

1:mysql-community-devel ########################################### [100%]

7.使用命令启动mysql服务

service mysqld start

[root@localhost mysql-5.7.25]# service mysqld start

Starting mysqld: [ OK ]

[root@localhost mysql-5.7.25]#

8.使用命令生成一个随机密码:grep "temporary password" /var/log/mysqld.log

[root@localhost mysql-5.7.25]# grep "temporary password" /var/log/mysqld.log

2020-04-07T12:32:39.276158Z 1 [Note] A temporary password is generated for root@localhost: >v>uyo:fg7.O

[root@localhost mysql-5.7.25]#

注意:密码是root@localhost:右边的字符串

root@localhost: >v>uyo:fg7.O   这里生成的随机密码是:>v>uyo:fg7.O

MySQL 会在 /var/log/mysqld.log 日志中生成一个随机密码,默认需要修改密码才能使用

可以通过 vim  /var/log/mysqld.log 打开里面有一行这样的代码

2020-04-07T12:32:39.276158Z 1 [Note] A temporary password is generated for root@localhost: >v>uyo:fg7.O

9.修改密码,先登录mysql

mysql -u root –p

[root@localhost mysql-5.7.25]# mysql -u root -p

Enter password:

我这随机密码就是:>v>uyo:fg7.O

10.登录成功

[root@localhost log]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 12

Server version: 5.7.25

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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'wangqing';

Query OK, 0 rows affected (0.01 sec)

mysql>

11.修改密码:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';

12.设置权限

为了可以远程连接该数据库,需要设置相应的权限

#任何主机

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '刚刚修改的密码' WITH GRANT OPTION;

#指定主机

mysql>GRANT ALL PRIVILEGES ON *.* TO 'xxxx'@’xx.xx.xx.xx’ IDENTIFIED BY 'xxxx' WITH GRANT OPTION;

13.刷新权限

mysql>flush privileges;

这就完成了,可以用sql工具连接mysql了

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/367248.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Linux自动化之Cobbler补鞋匠安装

cobbler介绍: 快速网络安装linux操作系统的服务,支持众多的Linux发行版:Red Hat、 Fedora、CentOS、Debian、Ubuntu和SuSE,也可以支持网络安装windows PXE的二次封装,将多种安装参数封装到一个菜单 Python编…

如何以10倍速加速Apache Xalan的XPath处理器

一段时间以来, Apache Xalan中存在一个令人尴尬的错误,该错误是XALANJ-2540 。 此错误的后果是Xalan每次XPath表达式求值将内部SPI配置文件加载数千次 ,可以很容易地进行如下测量: 这个: Element e (Element)documen…

使用ant design Pro开发项目的小结

一、关于上手。 1. 关于ant design Pro的介绍,自己看官网,大致上可以理解为ant design(组件库) ant design Pro (完整的项目) dva(路由 数据流管理)的组合拳。总之这个Pro是一个已经…

Activiti中的高级脚本:自定义配置注入

脚本任务可能是Activiti代码库中“最古老的”类之一,但我认为它仍然未被许多人使用。 (可以理解的?)缺点当然是性能(解释还是编译),并且从IDE角度来看支持较少。 但是,好处&#xf…

帆软决策报表嵌入html,在决策报表中使用网页框控件

假设决策报表里有一个网页框控件,控件名为rHIframe0;同时有三个按钮控件,分别给按钮控件添加下面的点击事件:3.1 setValue(String)设置并刷新网页框控件的地址(保留原参数)1)模板路径var Widget this.options.form.getWidgetByNa…

【前端轶事】Chrome 小恐龙背后的故事

本文转自 FEPulse 公众号(微信搜索 FEPulse,精选国内外最新前端资讯,为你把握前端脉搏)。 如果你是 Chrome 用户,一定对那萌萌哒的小恐龙不陌生,每当互联网连接断开时,你便能看到那只小恐龙&am…

《React源码解析》系列完结!

前言 距离第一篇《React源码解析(一)》已经过去将近4个月的时间,由于是我第一次进行源码解析相关的写作,思路和文笔还不够成熟。一百多天以来,我基于读者反馈反思这几篇文章中的不足,同时也在不断学习借鉴其他优秀作者的写作方法…

html5 css 字体加粗,HTML和CSS实现字体加粗的三种方法

大家在浏览网站时有没有注意到,页面中有些文字或字体加粗了,正在学习HTML和CSS的小伙伴,你知道HTML如何给文字加粗吗?CSS怎么设置字体加粗呢?这篇文章给大家总结了给字体和文字加粗的三种方法,包括HTML中的…

虾扯蛋之函数防抖和节流

背景 今天在coding的时候,做了一个搜索框,也正是这个搜索框,让我和后台小伙伴直接由铁磁变为塑料兄弟。那到底发生啥了呢?其实很简单,其实很无奈,就是我用王者的手速把他的接口访问崩了! 我们在…

四川省内二本计算机公立好的大学排名,四川有哪些二本院校是公立的?附四川省公立二本大学排名及分数线...

选择科目测一测我能上哪些大学选择科目领取你的专属报告>选择省份关闭请选择科目确定v>四川省内的公办大学一直以来都是历年高考生及家长关注的重点,本篇文章我将针对“四川省有多少所二本公立大学?有哪四川省内的公办大学一直以来都是历年高考生及…

NetBeans 7.4 Beta提示警告无效的异常处理

有许多例子说明Java异常处理可能比首次出现时要困难得多,Josh Bloch专门将一整章的《 Effective Java》 (两个版本)专门用于异常处理。 Java中的检查异常模型 仍然 “ 有争议” 。 我很高兴看到我最近下载的NetBeans 7.4 beta有一些提示&…

mysql5.7.17解压版安装_Windows中 MySQL5.7.17解压版安装步骤

1、先去MySQL官网下载。当前最新版是5.7.19,可能安装方法不同了,本人测试没有安装成功,若有安装成功的朋友,希望分享一下安装步骤。2、将下载的压缩包解压出来,然后在“MySQL解压目录”中新建“data”文件夹。如下图&a…

关于Java和Scala同步的五件事你不知道

实际上,所有服务器应用程序都需要在多个线程之间进行某种同步。 大多数同步工作是在框架级别为我们完成的,例如通过我们的Web服务器,数据库客户端或消息传递框架。 Java和Scala提供了许多组件来编写可靠的多线程应用程序。 这些包括对象池&am…

精读《你不知道的javascript》中卷

前言 《你不知道的 javascript》是一个前端学习必读的系列,让不求甚解的JavaScript开发者迎难而上,深入语言内部,弄清楚JavaScript每一个零部件的用途。本书《你不知道的javascript》中卷介绍了该系列的两个主题:“类型和语法”以…

撸个微信小程序的省市区选择器

起因 微信小程序虽然已经有现成的封装好的省市区选择器给开发者使用,然鹅不幸的是,微信地址库的数据和公司用的地址库数据很难一一对上,那就只能撸起袖子自己写个组件了。 最终效果 思维导图 主要代码 组件 region-picker.js /* region-pic…

python之路_day6

本节内容&#xff1a;面向对象编程介绍为什么要用面向对象进行开发&#xff1f;面向对象的特性&#xff1a;封装、继承、多态类、方法、引子 你现在是一家游戏公司的开发人员&#xff0c;现在需要你开发一款叫做<人狗大战>的游戏&#xff0c;你就思考呀&#xff0c;人狗作…

MUI调用原生自定义方法实现计算缓存与清空缓存

由于项目需要最近在做webapp开发用的是MUI框架&#xff0c;自己本来是做原生开发的&#xff0c;在开发的时候有一个需求是实现计算缓存和清除缓存的功能&#xff0c;原生java方法实现轻轻松松&#xff0c;网上代码一大把&#xff0c;不过是webapp倒是不好搞&#xff0c;MUI自己…

Java中的多重继承与组合vs继承

有时我写了几篇有关Java 继承 &#xff0c; 接口和组成的文章。 在这篇文章中&#xff0c;我们将研究多重继承&#xff0c;然后学习组成优于继承的好处。 Java中的多重继承 多重继承是创建具有多个超类的单个类的能力。 与其他一些流行的面向对象的编程语言&#xff08;例如C …

开源|蚂蚁金服开源AntV F2:一个专注于移动,开箱即用的可视

小蚂蚁说&#xff1a;AntV 是蚂蚁金服全新一代数据可视化解决方案&#xff0c;主要子产品包括 G2、G6、F2。此前我们已经相继发布过AntV的相关开源消息与版本迭代&#xff0c;包括《蚂蚁金服开源&#xff1a;数据驱动的高交互可视化图形语法G2》&#xff0c;《开源 | 蚂蚁金服开…

Puppeteer入门初探

本文来自网易云社区作者&#xff1a;唐钊最近在看 node 爬虫相关的一些东西&#xff0c;我记得还是很久以前常用的 node 爬虫工具还是 superagengtcherrio,他们的思路是通过发起 http 请求然后截取 respone 的内容&#xff0c;但是随着前端mvvm等框架的盛行&#xff0c;现在更多…