广告
返回顶部
首页 > 资讯 > 数据库 >CentOS 6.7下yum方式怎么安装MySQL 5.6
  • 289
分享到

CentOS 6.7下yum方式怎么安装MySQL 5.6

2024-04-02 19:04:59 289人浏览 独家记忆
摘要

本篇文章给大家分享的是有关Centos 6.7下yum方式怎么安装Mysql 5.6,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。1、下载yu

本篇文章给大家分享的是有关Centos 6.7下yum方式怎么安装Mysql 5.6,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

1、下载yum源

 我的测试环境如下:

[root@test ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)

所以下载了centos6系统yum源:

wget Http://dev.mysql.com/get/mysql57-commUnity-release-el6-7.noarch.rpm

3、修改yum源配置

 vim /etc/yum.repos.d/mysql-community.repo

安装mysql5.6操作

1)、将其他版本enabled=1更改为enabled=0

2)、将5.6版本enabled=0更改为enabled=1

# Enable to use MySQL 5.6

[mysql56-community]

name=MySQL 5.6 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/

enabled=1

gpGCheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

4、开始现在安装包并安装

[root@test ~]# yum install mysql-community-server

已加载插件:fastestmirror, security

设置安装进程

Loading mirror speeds from cached hostfile

 * base: mirrors.aliyun.com

 * epel: mirrors.yun-idc.com

 * extras: mirrors.aliyun.com

 * updates: mirrors.aliyun.com

解决依赖关系

--> 执行事务检查

---> Package mysql-community-server.x86_64 0:5.6.47-2.el6 will be 安装

--> 处理依赖关系 mysql-community-common(x86-64) = 5.6.47-2.el6,它被软件包 mysql-community-server-5.6.47-2.el6.x86_64 需要

--> 处理依赖关系 mysql-community-client(x86-64) >= 5.6.10,它被软件包 mysql-community-server-5.6.47-2.el6.x86_64 需要

--> 执行事务检查

---> Package mysql-community-client.x86_64 0:5.6.47-2.el6 will be 安装

--> 处理依赖关系 mysql-community-libs(x86-64) >= 5.6.10,它被软件包 mysql-community-client-5.6.47-2.el6.x86_64 需要

---> Package mysql-community-common.x86_64 0:5.6.47-2.el6 will be 安装

--> 执行事务检查

---> Package mysql-community-libs.x86_64 0:5.6.47-2.el6 will be 安装

--> 完成依赖关系计算

依赖关系解决

================================================================================================================================================================

 软件包                                        架构                          版本                                仓库                                      大小

================================================================================================================================================================

正在安装:

 mysql-community-server                        x86_64                        5.6.47-2.el6                        mysql56-community                         77 M

为依赖而安装:

 mysql-community-client                        x86_64                        5.6.47-2.el6                        mysql56-community                         34 M

 mysql-community-common                        x86_64                        5.6.47-2.el6                        mysql56-community                        341 k

 mysql-community-libs                          x86_64                        5.6.47-2.el6                        mysql56-community                        3.6 M

事务概要

================================================================================================================================================================

Install       4 Package(s)

总文件大小:114 M

总下载量:77 M

Installed size: 478 M

确定吗?[y/N]:y

下载软件包:

mysql-community-server-5.6.47-2.el6.x86_64.rpm                                                                                           |  77 MB     43:30    

warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Importing GPG key 0x5072E1F5:

 Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>

 Package: mysql57-community-release-el6-7.noarch (installed)

 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

确定吗?[y/N]:y

运行 rpm_check_debug

执行事务测试

事务测试成功

执行事务

Warning: RPMDB altered outside of yum.

  正在安装   : mysql-community-common-5.6.47-2.el6.x86_64                                                                                                   1/4

  正在安装   : mysql-community-libs-5.6.47-2.el6.x86_64                                                                                                     2/4

  正在安装   : mysql-community-client-5.6.47-2.el6.x86_64                                                                                                   3/4

  正在安装   : mysql-community-server-5.6.47-2.el6.x86_64                                                                                                   4/4

  Verifying  : mysql-community-libs-5.6.47-2.el6.x86_64                                                                                                     1/4

  Verifying  : mysql-community-common-5.6.47-2.el6.x86_64                                                                                                   2/4

  Verifying  : mysql-community-client-5.6.47-2.el6.x86_64                                                                                                   3/4

  Verifying  : mysql-community-server-5.6.47-2.el6.x86_64                                                                                                   4/4

已安装:

  mysql-community-server.x86_64 0:5.6.47-2.el6                                                                                                                 

作为依赖被安装:

  mysql-community-client.x86_64 0:5.6.47-2.el6         mysql-community-common.x86_64 0:5.6.47-2.el6         mysql-community-libs.x86_64 0:5.6.47-2.el6       

完毕!

5、启动mysql服务

[root@test ~]# service mysqld start

初始化 MySQL 数据库: 2020-03-30 23:47:20 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

2020-03-30 23:47:20 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.

PLEASE REMEMBER TO SET A PASSWord FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

  /usr/bin/mysqladmin -u root password 'new-password'

  /usr/bin/mysqladmin -u root -h test password 'new-password'

Alternatively you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test

Note: new default config file not created.

Please make sure your config file is current

WARNING: Default config file /etc/my.cnf exists on the system

This file will be read by default by the MySQL Server

If you do not want to use this, either remove it, or use the

--defaults-file argument to mysqld_safe when starting the server

                                                           [确定]

正在启动 mysqld:                                          [确定]

6、查看状态和版本

[root@test ~]#  chkconfig --list | grep mysqld

mysqld          0:关闭  1:关闭  2:关闭  3:启用  4:启用  5:启用  6:关闭

[root@test ~]# mysqladmin --version

mysqladmin  Ver 8.42 Distrib 5.6.47, for linux on x86_64

[root@test ~]#  mysqladmin -u root password "mysql123"

Warning: Using a password on the command line interface can be insecure.

[root@test ~]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 3

Server version: 5.6.47 MySQL Community Server (GPL)

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.

7、设置root用户密码

[root@test ~]#  mysqladmin -u root password "mysql123"

Warning: Using a password on the command line interface can be insecure.

8、查看数据库和创建数据库

[root@test mysql]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 5

Server version: 5.6.47 MySQL Community Server (GPL)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| infORMation_schema |

| mysql              |

| performance_schema |

+--------------------+

3 rows in set (0.00 sec)

mysql> CREATE DATABASE testtb DEFAULT CHARSET utf8 COLLATE utf8_general_ci;

Query OK, 1 row affected (0.00 sec)

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| testtb             |

+--------------------+

4 rows in set (0.00 sec)

9、查看数据库目录

[root@test ~]# ls /var/lib/mysql -al

总用量 110616

drwxr-xr-x   5 mysql mysql     4096 3月  31 00:19 .

drwxr-xr-x. 30 root  root      4096 3月  30 20:57 ..

-rw-rw----   1 mysql mysql       56 3月  30 23:47 auto.cnf

-rw-rw----   1 mysql mysql 12582912 3月  30 23:47 ibdata1

-rw-rw----   1 mysql mysql 50331648 3月  30 23:47 ib_logfile0

-rw-rw----   1 mysql mysql 50331648 3月  30 23:47 ib_logfile1

drwx------   2 mysql mysql     4096 3月  30 23:47 mysql

srwxrwxrwx   1 mysql mysql        0 3月  30 23:47 mysql.sock

drwx------   2 mysql mysql     4096 3月  30 23:47 performance_schema

drwx------   2 mysql mysql     4096 3月  31 00:19 testtb

以上就是CentOS 6.7下yum方式怎么安装MySQL 5.6,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注编程网数据库频道。

您可能感兴趣的文档:

--结束END--

本文标题: CentOS 6.7下yum方式怎么安装MySQL 5.6

本文链接: https://www.lsjlt.com/news/61470.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • CentOS 6.7下yum方式怎么安装MySQL 5.6
    本篇文章给大家分享的是有关CentOS 6.7下yum方式怎么安装MySQL 5.6,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。1、下载yu...
    99+
    2022-10-18
  • CentOS 6.7下如何通过源码编译安装MySQL 5.6
    这篇文章主要为大家展示了“CentOS 6.7下如何通过源码编译安装MySQL 5.6”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“CentOS 6.7下如何通...
    99+
    2022-10-18
  • CentOS下怎么重新安装yum源
    这篇文章主要讲解了“CentOS下怎么重新安装yum源”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CentOS下怎么重新安装yum源”吧!在SSH里面依次输入下面的命令:1,下载最新的yu...
    99+
    2023-06-10
  • CentOS下使用yum方式安装percona xtrabackup步骤
    编辑/etc/yum.repos.d/Percona.repo,加入以下内容: #vi /etc/yum.repos.d/Percona.repo [percona] name = CentOS $rele...
    99+
    2022-10-18
  • 怎么在CentOS系统中使用yum方式安装vsftpd
    这篇文章将为大家详细讲解有关怎么在CentOS系统中使用yum方式安装vsftpd,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。安装vsftp使用yum命令安装vsftp[root@iZ23...
    99+
    2023-06-10
  • centos 7上怎么使用yum下载安装php
    在CentOS 7中安装 PHP 有不同的方法,但使用 yum 命令是最简单且最常用的方法。yum 是 Centos 所有用户最常用的软件包管理器。本文将介绍通过 yum 在 CentOS 7上安装 PHP的步骤。准备工作在开始之前,我们需...
    99+
    2023-05-14
    Centos7 yum php
  • Linux下如何使用yum的方式安装mysql
    这篇文章将为大家详细讲解有关Linux下如何使用yum的方式安装mysql,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。\1. 先检查系统是否装有mysql[root@localhost ~]#...
    99+
    2023-06-27
  • linux中怎么使用yum方式安装mysql
    今天就跟大家聊聊有关linux中怎么使用yum方式安装mysql,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。linux下使用yum安装mysql&...
    99+
    2022-10-18
  • CentOS7下怎么用yum方式安装Docker环境
    这篇文章主要讲解了“CentOS7下怎么用yum方式安装Docker环境”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CentOS7下怎么用yum方式安装Docker环境”吧!记录在Cent...
    99+
    2023-06-05
  • 怎么在CentOS中使用yum方式安装VLC播放器
    这篇文章将为大家详细讲解有关怎么在CentOS中使用yum方式安装VLC播放器,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。Linux环境:CentOS 6.5以下安装命令使用root用户权...
    99+
    2023-06-10
  • Centos下安装mysql命令怎么写
    这篇文章主要为大家展示了“Centos下安装mysql命令怎么写”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Centos下安装mysql命令怎么写”这篇文章吧...
    99+
    2022-10-19
  • CentOS 6.5下怎么快速安装MySQL 5.7.17
    本文小编为大家详细介绍“CentOS 6.5下怎么快速安装MySQL 5.7.17”,内容详细,步骤清晰,细节处理妥当,希望这篇“CentOS 6.5下怎么快速安装MySQL 5.7.17”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入...
    99+
    2023-06-27
  • Centos7上怎么用官方YUM源安装Mysql
    本篇内容主要讲解“Centos7上怎么用官方YUM源安装Mysql”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Centos7上怎么用官方YUM源安装Mysql”吧! 下载mysql的repo源...
    99+
    2023-06-05
  • yum方式安装Percona XtraBackup报错怎么办
    小编给大家分享一下yum方式安装Percona XtraBackup报错怎么办,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧! ...
    99+
    2022-10-18
  • 关于linux-Centos 7下mysql 5.7.9的rpm包的安装方式
    环境介绍>>>>>>>>>>>>>>>>>>操作系统:Centos 7.1mysql数据库版本:m...
    99+
    2022-10-18
  • centos怎么安装桌面快捷方式
    这篇文章主要介绍了centos怎么安装桌面快捷方式,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。右击Desktop,点击“Create Launcher”。直接输入或者Bro...
    99+
    2023-06-10
  • CentOS6下怎么用RPM方式安装MySQL5.6
    这篇文章主要介绍“CentOS6下怎么用RPM方式安装MySQL5.6”,在日常操作中,相信很多人在CentOS6下怎么用RPM方式安装MySQL5.6问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操...
    99+
    2022-10-18
  • Centos7怎么用rpm方式安装mysql-5.5
    这篇文章主要讲解了“Centos7怎么用rpm方式安装mysql-5.5”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Centos7怎么用rpm方式安装my...
    99+
    2022-10-18
  • Mysql for Linux怎么用rpm方式安装和配置
    这篇文章主要讲解了“Mysql for Linux怎么用rpm方式安装和配置”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Mysql for Linux怎么...
    99+
    2022-10-18
  • Mysql for Linux怎么用二进制方式安装和配置
    本篇内容介绍了“Mysql for Linux怎么用二进制方式安装和配置”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作