千家信息网

如何使用yum方式安装mysql5.7 on linux_64

发表于:2025-11-08 作者:千家信息网编辑
千家信息网最后更新 2025年11月08日,这篇文章主要介绍了如何使用yum方式安装mysql5.7 on linux_64,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。1.下载
千家信息网最后更新 2025年11月08日如何使用yum方式安装mysql5.7 on linux_64

这篇文章主要介绍了如何使用yum方式安装mysql5.7 on linux_64,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

1.下载并安装RPM
https://dev.mysql.com/downloads/repo/yum/
rpm -ivh mysql57-community-release-el6-11.noarch.rpm

2.确认安装成功

点击(此处)折叠或打开

  1. # yum repolist enabled | grep "mysql.*-community.*"

  2. This system is not registered with RHN.

  3. RHN support will be disabled.

  4. http://repo.mysql.com/yum/mysql-connectors-community/el/6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - ""

  5. Trying other mirror.

  6. mysql-connectors-community MySQL Connectors Community 0

  7. mysql-tools-community MySQL Tools Community 0

  8. mysql57-community MySQL 5.7 Community Server 0

3.选择安装程序
编辑文件/etc/yum.repos.d/mysql-community.repo,将想安装的版本条目enable=1

点击(此处)折叠或打开

  1. [mysql57-community]

  2. name=MySQL 5.7 Community Server

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

  4. enabled=0

  5. gpgcheck=1

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

点击(此处)折叠或打开

  1. # yum repolist enabled | grep mysql

  2. This system is not registered with RHN.

  3. RHN support will be disabled.

  4. mysql57-community MySQL 5.7 Community Server 237


4.确保连接至internet

点击(此处)折叠或打开

  1. [root@mysql1 network-scripts]# cat ifcfg-eth0

  2. DEVICE="eth0"

  3. HWADDR="00:0C:29:68:EC:D8"

  4. NM_CONTROLLED="yes"

  5. ONBOOT="yes"

  6. BOOTPROTO=none

  7. IPADDR=192.168.1.200

  8. NETMASK=255.255.255.0

  9. GATEWAY=192.168.1.1

  10. [root@mysql1 network-scripts]# cat /etc/resolv.conf

  11. nameserver 114.114.114.114

  12. nameserver 8.8.8.8

  13. nameserver 192.168.0.1

点击(此处)折叠或打开

  1. curl http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/repodata/repomd.xml


5.安装mysql

点击(此处)折叠或打开

  1. # yum install mysql-community-server

  2. Loaded plugins: rhnplugin

  3. This system is not registered with RHN.

  4. RHN support will be disabled.

  5. Setting up Install Process

  6. Resolving Dependencies

  7. --> Running transaction check

  8. ---> Package mysql-community-server.x86_64 0:5.7.21-1.el6 set to be updated

  9. --> Processing Dependency: mysql-community-common(x86-64) = 5.7.21-1.el6 for package: mysql-community-server-5.7.21-1.el6.x86_64

  10. --> Processing Dependency: mysql-community-client(x86-64) >= 5.7.9 for package: mysql-community-server-5.7.21-1.el6.x86_64

  11. --> Processing Dependency: perl(strict) for package: mysql-community-server-5.7.21-1.el6.x86_64

  12. --> Processing Dependency: perl(POSIX) for package: mysql-community-server-5.7.21-1.el6.x86_64

  13. --> Processing Dependency: perl(Getopt::Long) for package: mysql-community-server-5.7.21-1.el6.x86_64

  14. --> Processing Dependency: perl(File::Path) for package: mysql-community-server-5.7.21-1.el6.x86_64

  15. --> Processing Dependency: libnuma.so.1(libnuma_1.2)(64bit) for package: mysql-community-server-5.7.21-1.el6.x86_64

  16. --> Processing Dependency: libnuma.so.1(libnuma_1.1)(64bit) for package: mysql-community-server-5.7.21-1.el6.x86_64

  17. --> Processing Dependency: /usr/bin/perl for package: mysql-community-server-5.7.21-1.el6.x86_64

  18. --> Processing Dependency: libnuma.so.1()(64bit) for package: mysql-community-server-5.7.21-1.el6.x86_64

  19. --> Running transaction check

  20. ---> Package mysql-community-client.x86_64 0:5.7.21-1.el6 set to be updated

  21. --> Processing Dependency: mysql-community-libs(x86-64) >= 5.7.9 for package: mysql-community-client-5.7.21-1.el6.x86_64

  22. ---> Package mysql-community-common.x86_64 0:5.7.21-1.el6 set to be updated

  23. ---> Package numactl.x86_64 0:2.0.3-9.el6 set to be updated

  24. ---> Package perl.x86_64 4:5.10.1-115.el6 set to be updated

  25. --> Processing Dependency: perl-libs = 4:5.10.1-115.el6 for package: 4:perl-5.10.1-115.el6.x86_64

  26. --> Processing Dependency: perl(version) for package: 4:perl-5.10.1-115.el6.x86_64

  27. --> Processing Dependency: perl-libs for package: 4:perl-5.10.1-115.el6.x86_64

  28. --> Processing Dependency: perl(Pod::Simple) for package: 4:perl-5.10.1-115.el6.x86_64

  29. --> Processing Dependency: perl(Module::Pluggable) for package: 4:perl-5.10.1-115.el6.x86_64

  30. --> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.10.1-115.el6.x86_64

  31. --> Running transaction check

  32. ---> Package mysql-community-libs.x86_64 0:5.7.21-1.el6 set to be updated

  33. ---> Package perl-Module-Pluggable.x86_64 1:3.90-115.el6 set to be updated

  34. ---> Package perl-Pod-Simple.x86_64 1:3.13-115.el6 set to be updated

  35. --> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.13-115.el6.x86_64

  36. ---> Package perl-libs.x86_64 4:5.10.1-115.el6 set to be updated

  37. ---> Package perl-version.x86_64 3:0.77-115.el6 set to be updated

  38. --> Running transaction check

  39. ---> Package perl-Pod-Escapes.x86_64 1:1.04-115.el6 set to be updated

  40. --> Finished Dependency Resolution


  41. Dependencies Resolved


  42. ==============================================================================================================================================================================================================================================================================

  43. Package Arch Version Repository Size

  44. ==============================================================================================================================================================================================================================================================================

  45. Installing:

  46. mysql-community-server x86_64 5.7.21-1.el6 mysql57-community 152 M

  47. Installing for dependencies:

  48. mysql-community-client x86_64 5.7.21-1.el6 mysql57-community 23 M

  49. mysql-community-common x86_64 5.7.21-1.el6 mysql57-community 329 k

  50. mysql-community-libs x86_64 5.7.21-1.el6 mysql57-community 2.1 M

  51. numactl x86_64 2.0.3-9.el6 test 55 k

  52. perl x86_64 4:5.10.1-115.el6 test 10 M

  53. perl-Module-Pluggable x86_64 1:3.90-115.el6 test 36 k

  54. perl-Pod-Escapes x86_64 1:1.04-115.el6 test 29 k

  55. perl-Pod-Simple x86_64 1:3.13-115.el6 test 208 k

  56. perl-libs x86_64 4:5.10.1-115.el6 test 576 k

  57. perl-version x86_64 3:0.77-115.el6 test 48 k


  58. Transaction Summary

  59. ==============================================================================================================================================================================================================================================================================

  60. Install 11 Package(s)

  61. Upgrade 0 Package(s)


  62. Total download size: 189 M

  63. Installed size: 919 M

  64. Is this ok [y/N]: y

  65. Downloading Packages:

  66. (1/11): mysql-community-client-5.7.21-1.el6.x86_64.rpm | 23 MB 00:09

  67. (2/11): mysql-community-common-5.7.21-1.el6.x86_64.rpm | 329 kB 00:00

  68. (3/11): mysql-community-libs-5.7.21-1.el6.x86_64.rpm | 2.1 MB 00:01

  69. (4/11): mysql-community-server-5.7.21-1.el6.x86_64.rpm | 152 MB 03:16

  70. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  71. Total 925 kB/s | 189 MB 03:28

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

  73. mysql57-community/gpgkey | 54 kB 00:00 ...

  74. Importing GPG key 0x5072E1F5 "MySQL Release Engineering " from /etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

  75. Is this ok [y/N]: y

  76. Running rpm_check_debug

  77. Running Transaction Test

  78. Transaction Test Succeeded

  79. Running Transaction

  80. Installing : mysql-community-common-5.7.21-1.el6.x86_64 1/11

  81. Installing : mysql-community-libs-5.7.21-1.el6.x86_64 2/11

  82. Installing : mysql-community-client-5.7.21-1.el6.x86_64 3/11

  83. Installing : 1:perl-Pod-Escapes-1.04-115.el6.x86_64 4/11

  84. Installing : 3:perl-version-0.77-115.el6.x86_64 5/11

  85. Installing : 4:perl-libs-5.10.1-115.el6.x86_64 6/11

  86. Installing : 1:perl-Pod-Simple-3.13-115.el6.x86_64 7/11

  87. Installing : 1:perl-Module-Pluggable-3.90-115.el6.x86_64 8/11

  88. Installing : 4:perl-5.10.1-115.el6.x86_64 9/11

  89. Installing : numactl-2.0.3-9.el6.x86_64 10/11

  90. Installing : mysql-community-server-5.7.21-1.el6.x86_64 11/11


  91. Installed:

  92. mysql-community-server.x86_64 0:5.7.21-1.el6


  93. Dependency Installed:

  94. mysql-community-client.x86_64 0:5.7.21-1.el6 mysql-community-common.x86_64 0:5.7.21-1.el6 mysql-community-libs.x86_64 0:5.7.21-1.el6 numactl.x86_64 0:2.0.3-9.el6 perl.x86_64 4:5.10.1-115.el6 perl-Module-Pluggable.x86_64 1:3.90-115.el6

  95. perl-Pod-Escapes.x86_64 1:1.04-115.el6 perl-Pod-Simple.x86_64 1:3.13-115.el6 perl-libs.x86_64 4:5.10.1-115.el6 perl-version.x86_64 3:0.77-115.el6


  96. Complete!

启动服务

点击(此处)折叠或打开

  1. [root@mysql1 yum.repos.d]# service mysqld start

  2. Initializing MySQL database: [ OK ]

  3. Starting mysqld: [ OK ]

  4. [root@mysql1 yum.repos.d]# service mysqld status

  5. mysqld (pid 1628) is running..


6.修改root密码
-获得root初识密码

点击(此处)折叠或打开

  1. ]# grep 'temporary password' /var/log/mysqld.log

  2. 2018-02-25T22:53:03.372590Z 1 [Note] A temporary password is generated for root@localhost: +(LVH%nyg1vC

- 登录root
# mysql -uroot -p

-修改root密码

点击(此处)折叠或打开

  1. mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';

  2. Query OK, 0 rows affected (0.01 sec)

点击(此处)折叠或打开

  1. Grant all privileges on *.* to 'root'@'%' identified by 'MyNewPass4!' with grant option;

  2. flush privileges;

感谢你能够认真阅读完这篇文章,希望小编分享的"如何使用yum方式安装mysql5.7 on linux_64"这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!

篇文章 密码 方式 成功 价值 兴趣 同时 文件 更多 朋友 条目 版本 知识 程序 编带 行业 资讯 资讯频道 频道 参考 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 上海天象网络技术 计算机网络技术基本情况 提供软件开发多少钱 中科腾海高清服务器资料官网 您无归档数据库 苏州中太服务器 十八大以来网络安全工作报告 宁波专业软件开发设计 服务器的安装和使用 江苏省青少年网络安全知识竞赛题 火神软件开发好还是测试好 知了堂网络安全 武汉卓育软件开发有限公司官网 深入宣传网络安全法 软件开发在东莞好还是珠海好 谜底为网络安全的灯谜 镇江互联网科技有限公司 网络安全和执法类有关系吗 中信银行的软件开发怎么样 软件开发可以进公司吗 网络安全和域名解析 小米登录设备管理服务器错误 高淳区智能化软件开发专业服务 中职access数据库思维导图 火神软件开发好还是测试好 共青城市网络技术有限公司 网络安全密钥管理服务 荣耀手机服务器响应超时 inter 服务器最新cpu 创维软件开发面试题
0