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

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了

centos 离线安装mysql_CentOS6离线安装mysql-5.7.25相关推荐

  1. centos6.5 tar安装mysql_centos6.6安装mysql5.7.9tar包

    一.使用工具: 1.vmware10虚拟机 2.centos 6.6 3.secureCRT 二.系统设置: 1.安装文件下载目录:/home/tools/ 2.mysql安装目录:/usr/loca ...

  2. centos 6.3安装mysql_centos6.3安装MySQL 5.6(转)

    用已经注册好的oracle帐户登陆后才能下载,下载版本为mysql-5.6.15.tar.gz,也就是上图的最后一个包.python 2:必要软件包mysql yum -y install  gcc  ...

  3. centos 6.2安装mysql_centos6.2安装mysql

    最近在centos6.2上安装mysql,装不上,并且原来系统中也有mysql安装目录,好混乱的,几经折腾终于弄好了. 一.下载软件 下载地址:http://dev.mysql.com/downloa ...

  4. centos6.4 安装 mysql_CentOS6.4 安装MySQL

    首先我们通过命令yum list | grep mysql看看MySQL是否被安装过 [root@ecs-3c46 /]# yum list | grep mysql 然后通过yum的方式来进行mys ...

  5. centos6 lnmp安装mysql_centos6.5安装lnmp环境

    1.安装nignx的源,默认cenots6没有的. rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-cent ...

  6. otrs安装mysql_CentOS6.5安装OTRS3.3.9

    本机系统为CentOS6.5 1.安装LAMP的环境 yum -y install httpd php php-mysql mysql mysql-server perl-DBD-MySQL php- ...

  7. mysql客户端centos离线安装_mysql离线安装部署centos

    # 1. Mysql单机安装 前提:切换用户命令  su root ## 1.1 卸载系统自带的mysql ### 1.1.1查看已安装的mysql ``` [root@localhost ~]# r ...

  8. linux上离线安装mysql_Linux下安装mysql(离线安装和在线安装)

    一:在线安装mysql 1.首先检测一下,mysql之前有没有被安装 命令:rpm -qa | grep mysql 2.删除mysql的命令: rpm -e --nodeps `rpm -qa | ...

  9. CentOS mini 7下离线安装rabbitmq

    公司的开发环境没有联网,想要从一台崭新的mini centos7安装rabbitmq.用于后续的开发,由于对linux一点不懂,被这个依赖包的问题折磨完了. 不过最终还是找到一个办法. centos下 ...

最新文章

  1. Dubbo常见面试题及答案汇总1000道(春招+秋招+社招)
  2. AI时代的高科技读心术:算法解码脑中图像
  3. 一步一步学习C#(一)
  4. 如何将一棵LSM-Tree塞进NVM
  5. 1107: 回文数猜想(函数专题)
  6. Druid的外网访问异常
  7. 看到别人的简历,mark一下。
  8. 华为 MateBook 笔记本 Linux 版正式开售
  9. VMware 大中华区原厂认证讲师(大陆地区)2018 年 8 月 8 日更新
  10. Cocos2d-JS项目之三:使用合图
  11. 设计测试用例的7点原则
  12. 谷歌浏览器开启JavaScript
  13. clang-format的使用
  14. 【Cheatsheet】详解如何使用LaTeX Beamer制作PPT
  15. html自动生成拼音五笔,如何根据单元格汉字自动生成拼音码和五笔码
  16. 《我为什么熬夜?》系列之 倚天屠龙记
  17. 【调剂】中科院上海微系统与信息技术研究所2023年高校联培项目招收调剂生的通知...
  18. 帮Customer Architecture写的小脚本
  19. 【BLE】角色区分(master/slave, service/client)
  20. idea中找不到Lombok插件的问题

热门文章

  1. 蓝桥杯 n进制小数
  2. python每隔30s检查一次_用Python写一个“离线语音提示器”来提醒我们别忘记了时间...
  3. java 权限url权限_SpringBootSecurity学习(11)网页版登录之URL动态权限
  4. MATLAB凸包Convex hull运算
  5. 机器学习算法应用30篇(十)-通俗理解支持向量机SVM及代码实践
  6. js如何获取html图片,JS/JQuery获取网页或文章或某DIV所有图片
  7. shell编程入门 linux解释器原理,Shell编程入门Linux解释器原理详细介绍 使用Shell进行工作的人们对.doc...
  8. 教你玩转CSS Float(浮动)
  9. 云服务器带宽如何计算,云服务器怎么选择带宽
  10. css实现div内一段文本的两端对齐