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编…

html5中音频的标签,html5中的音频标签安全

有点.Grooveshark向正在流式传输的MP3的服务器端脚本发送POST请求,这使得很难在不自动创建POST请求的情况下访问和欺骗,特别是看到您将不得不尝试存储音频文件那是收集的.但是您可以使用新的AudioContext来帮助大多数现代平台解决这个问题我使用HTML5Rocks.com的一个很好的例子…

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

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

反射例子(配置文件)

配置文件 className fanshe.Student1 showInfo show1 类student1 public class Student1 {public Student1() {System.out.println("调用了Student1 无参构造函数");}public void show1(){System.out.println("调用了show1()方法");} } 测试类 public cl…

503 Next Greater Element II 下一个更大元素 II

给定一个循环数组(最后一个元素的下一个元素是数组的第一个元素),输出每个元素的下一个更大元素。数字 x 的下一个更大的元素是按数组遍历顺序,这个数字之后的第一个比它更大的数,这意味着你应该循环地搜索它的下一个更…

mysql update nowait_mysql innodb之select for update nowait

作者: 弦乐之花 | 可以转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明mysql innodb之select for update nowait习惯了oracle数据库的select for update nowait的同学,如果转在mysql环境开发的话,也许会不太适应——目前builtin版本的inn…

使用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…

CentOS7.4搭建ftp服务

1.使用yum安装vsftpd yum install vsftpd -y 2.安装完成后,启动 FTP 服务: service vsftpd start 3.配置ftp权限 目前 FTP 服务登陆允许匿名登陆,也无法区分用户访问,为了安全,我们需要设置一下ftp权限 vsftpd 的配置目…

mysql binlog redo_mysql的binlog与redo log

binlogMysql Binlog是二进制格式的日志文件,用来记录Mysql内部对数据库的改动(只记录对数据的修改操作),主要用于数据库的主从复制以及增量恢复。获取binlog日志列表MariaDB [examples]> show master logs;----------------------| Log_name | File_s…

如何把网址配置为http和https可以同时访问

1.打开iis7 ,找到具体站点 2.点击站点后右侧有个绑定按钮 3.点击绑定,增加https,设置端口,ssl选择 iis证书 4.找到ssl设置,要求证书不勾选,客户证书,忽略 5.如果右侧不显示浏览站点https,点击站点高级设置-已启用协议&…

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

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

高起专计算机专业答案,Windows知识题(高起专)答案

WORD格式可编辑.第2章Windows操作系统及其应用(单选题)1.Windows操作系统的主要功能是___B___。A.实现软、硬件转换B.管理计算机系统所有的软、硬件C.把源程序转换为目标程序D.进行数据处理提示:操作系统属于系统软件,它的主要功能是:管理系统…

深浅copy

深浅copy对比 列表赋值 例如:列表a[‘a’, b, c, d, 1, 2, 3],当执行代码ba,可以得到b[‘a’, b, c, d, 1, 2, 3],具体实现如下: >>> a[a, b, c, d, 1, 2, 3] >>> ba >>> id(a),id(b) (280…

mysql5 varchar_MYSQL 5.7 VARCHAR 类型实验

MYSQL 的VARCHAR 类型字段的最多能存储多少字符?模糊记得 VARCHAR 最多能存65535个字符,真的吗?理论上,一个字符类型能存的字符数量跟选取的编码字符集和存储长度限制肯定是有关系的,字符编码长度越小,长度…

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

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

优化Java序列化– Java,XML,JSON,Kryo,POF

也许我很天真,但是我一直认为Java序列化肯定是将Java对象序列化为二进制形式的最快,最有效的方法。 毕竟Java是第7个主要发行版,所以这不是新技术,并且由于每个JDK似乎都比上一个快,因此我错误地认为序列化现在必须非常…

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

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

浅谈模拟退火

核心思想 模拟退火十分好写,它的核心思想就是: 每一次降温都可以从当前状态转移到另一种相近状态(没有严格定义,可以自己想产生相近解的方法) 如果那个相近状态的答案更优,当然转移到那种状态! …