我的编程空间,编程开发者的网络收藏夹
学习永远不晚

Linux平台用RPM包方式安装Mysql 5.7

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

Linux平台用RPM包方式安装Mysql 5.7

这篇文章主要讲解了“Linux平台用RPM包方式安装Mysql 5.7”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Linux平台用RPM包方式安装Mysql 5.7”吧!

在 Mysql 官网下载 RPM 的 bundle 包并解压。

[root@localhost mysql5.7]# tar xvf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar

单独安装 Server 包,报依赖关系的错误。

[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm 
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-client(x86-64) = 5.7.10-1.el6 is needed by mysql-community-server-5.7.10-1.el6.x86_64
mysql-community-common(x86-64) = 5.7.10-1.el6 is needed by mysql-community-server-5.7.10-1.el6.x86_64

将所需的包添加上,依然报错,缺少另外一个包。

[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm 
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
error: Failed dependencies:
mysql-community-libs(x86-64) = 5.7.10-1.el6 is needed by mysql-community-client-5.7.10-1.el6.x86_64

将所需的包添加上,继续报错,和系统自带的 5.1 版本冲突。

[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-libs-5.7.10-1.el6.x86_64.rpm 
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
file /usr/share/mysql/czech/errmsg.sys from install of mysql-community-common-5.7.10-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64
file /usr/share/mysql/danish/errmsg.sys from install of mysql-community-common-5.7.10-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.73-5.el6_6.x86_64

卸载掉报错的mysql 5.1安装包

[root@T400-kelong software]# yum remove mysql-libs-5.1.73-5.el6_6.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be erased
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Running transaction check
---> Package perl-DBD-MySQL.x86_64 0:4.013-3.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                                  Arch                             Version                                     Repository                       Size
=============================================================================================================================================================
Removing:
 mysql-libs                               x86_64                           5.1.73-5.el6_6                              @base                           4.0 M
Removing for dependencies:
 perl-DBD-MySQL                           x86_64                           4.013-3.el6                                 @base                           338 k

Transaction Summary
=============================================================================================================================================================
Remove        2 Package(s)

Installed size: 4.4 M
Is this ok [y/N]: y

安装 RPM 包

[root@T400-kelong software]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm mysql-community-common-5.7.10-1.el6.x86_64.rpm mysql-community-client-5.7.10-1.el6.x86_64.rpm mysql-community-libs-5.7.10-1.el6.x86_64.rpm 
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-common ########################################### [ 25%]
   2:mysql-community-libs   ########################################### [ 50%]
   3:mysql-community-client ########################################### [ 75%]
   4:mysql-community-server ########################################### [100%]

启动数据库。

[root@T400-kelong sbin]# service mysqld start
初始化 MySQL 数据库:                                      [确定]
正在启动 mysqld:                                          [确定]
[root@T400-kelong sbin]# service mysqld status
mysqld (pid  4782) 正在运行...

[root@T400-kelong sbin]# ps -ef|grep mysql
root      4586     1  0 21:11 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql     4782  4586  2 21:11 pts/1    00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root      4847  3857  0 21:11 pts/1    00:00:00 grep mysql


使用临时密码登录到 ROOT 用户,更改 ROOT 密码。

grep 'temporary password' /var/log/mysql/mysqld.log

[root@T400-kelong sbin]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.10

Copyright (c) 2000, 2015, 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 'System#2013';
Query OK, 0 rows affected (0.00 sec)

感谢各位的阅读,以上就是“Linux平台用RPM包方式安装Mysql 5.7”的内容了,经过本文的学习后,相信大家对Linux平台用RPM包方式安装Mysql 5.7这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

Linux平台用RPM包方式安装Mysql 5.7

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

下载Word文档

编程热搜

目录