使用rpm安装mysql5.6(简单安装 实验使用)

Posted 张小贱1987

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用rpm安装mysql5.6(简单安装 实验使用)相关的知识,希望对你有一定的参考价值。

  1. [[email protected] mysql]# mkdir mysql
  2. [[email protected] mysql]# cd mysql
  3. [[email protected] mysql]# wget https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.36-1.el7.x86_64.rpm-bundle.tar
  4. [[email protected] mysql]# tar -xf MySQL-5.6.36-1.el7.x86_64.rpm-bundle.tar
  5. [[email protected] mysql]# ls
  6. MySQL-5.6.36-1.el7.x86_64.rpm-bundle.tar MySQL-devel-5.6.36-1.el7.x86_64.rpm MySQL-server-5.6.36-1.el7.x86_64.rpm MySQL-shared-compat-5.6.36-1.el7.x86_64.rpm
  7. MySQL-client-5.6.36-1.el7.x86_64.rpm MySQL-embedded-5.6.36-1.el7.x86_64.rpm MySQL-shared-5.6.36-1.el7.x86_64.rpm MySQL-test-5.6.36-1.el7.x86_64.rpm
  8. [[email protected] mysql]# rmp -i MySQL-devel-5.6.36-1.el7.x86_64.rpm
  9. [[email protected] mysql]# rmp -i MySQL-client-5.6.36-1.el7.x86_64.rpm
  10. [[email protected] mysql]# rpm -ivh MySQL-server-5.6.36-1.el7.x86_64.rpm
  11. 警告:MySQL-server-5.6.36-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
  12. 准备中... ################################# [100%]
  13.    file /usr/share/mysql/charsets/README from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  14.    file /usr/share/mysql/czech/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  15.    file /usr/share/mysql/danish/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  16.    file /usr/share/mysql/dutch/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  17.    file /usr/share/mysql/english/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  18.    file /usr/share/mysql/estonian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  19.    file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  20.    file /usr/share/mysql/german/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  21.    file /usr/share/mysql/greek/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  22.    file /usr/share/mysql/hungarian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  23.    file /usr/share/mysql/italian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  24.    file /usr/share/mysql/japanese/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  25.    file /usr/share/mysql/korean/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  26.    file /usr/share/mysql/norwegian-ny/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  27.    file /usr/share/mysql/norwegian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  28.    file /usr/share/mysql/polish/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  29.    file /usr/share/mysql/portuguese/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  30.    file /usr/share/mysql/romanian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  31.    file /usr/share/mysql/russian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  32.    file /usr/share/mysql/serbian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  33.    file /usr/share/mysql/slovak/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  34.    file /usr/share/mysql/spanish/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  35.    file /usr/share/mysql/swedish/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  36.    file /usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  37.    file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  38.    file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  39.    file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  40.    file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  41.    file /usr/share/mysql/charsets/cp1251.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  42.    file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  43.    file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  44.    file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  45.    file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  46.    file /usr/share/mysql/charsets/cp866.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  47.    file /usr/share/mysql/charsets/dec8.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  48.    file /usr/share/mysql/charsets/geostd8.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  49.    file /usr/share/mysql/charsets/greek.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  50.    file /usr/share/mysql/charsets/hebrew.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  51.    file /usr/share/mysql/charsets/hp8.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  52.    file /usr/share/mysql/charsets/keybcs2.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  53.    file /usr/share/mysql/charsets/koi8r.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  54.    file /usr/share/mysql/charsets/koi8u.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  55.    file /usr/share/mysql/charsets/latin1.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  56.    file /usr/share/mysql/charsets/latin2.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  57.    file /usr/share/mysql/charsets/latin5.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  58.    file /usr/share/mysql/charsets/latin7.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  59.    file /usr/share/mysql/charsets/macce.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  60.    file /usr/share/mysql/charsets/macroman.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  61.    file /usr/share/mysql/charsets/swe7.xml from install of MySQL-server-5.6.36-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.35-3.el7.x86_64
  62. //冲突了 删除mariadb-libs-1:5.5.35-3.el7.x86_64
  63. [[email protected] mysql]# rpm -e mariadb-libs-1:5.5.35-3.el7.x86_64
  64. 错误:依赖检测失败:
  65.    libmysqlclient.so.18()(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要
  66.    libmysqlclient.so.18(libmysqlclient_18)(64bit) 被 (已安裝) postfix-2:2.10.1-6.el7.x86_64 需要
  67. [[email protected] mysql]# rpm -e --nodeps mariadb-libs-1:5.5.35-3.el7.x86_64
  68. [[email protected] mysql]# rpm -ivh MySQL-server-5.6.36-1.el7.x86_64.rpm
  69. 警告:MySQL-server-5.6.36-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
  70. 准备中... ################################# [100%]
  71. 正在升级/安装...
  72.    1:MySQL-server-5.6.36-1.el7 ################################# [100%]
  73. 警告:用户mysql 不存在 - 使用root
  74. 警告:群组mysql 不存在 - 使用root
  75. 警告:用户mysql 不存在 - 使用root
  76. 警告:群组mysql 不存在 - 使用root
  77. FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
  78. Data::Dumper
  79.  
  80. //解决上面的error
  81. [[email protected] mysql]# yum install -y perl perl-devel
  82. //卸载重装
  83. [[email protected] mysql]# rpm -e MySQL-server-5.6.36-1.el7.x86_64
  84. //没有报错
  85. [[email protected] mysql]# rpm -ivh MySQL-client-5.6.36-1.el7.x86_64.rpm
  86. 警告:MySQL-client-5.6.36-1.el7.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
  87. 准备中... ################################# [100%]
  88. 正在升级/安装...
  89.    1:MySQL-client-5.6.36-1.el7 ################################# [100%]
  90. //启动报错
  91. [[email protected] mysql]# service mysql start
  92. Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
  93. //网上看原因说是需要这个
  94. [[email protected] mysql]# yum install -y perl-Data-Dumper
  95. //还是报错
  96. [[email protected] mysql]# service mysql start
  97. Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).
  98. //做了这个处理之后就不报错了 这个是安装后必须的一步 会安装系统表 不知道为什么不在rpm中处理这一步
  99. [[email protected] mysql]# mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
  100. //启动成功
  101. [[email protected] mysql]# service mysql start
  102. Starting MySQL. SUCCESS!
  103. //客户端连接
  104. [[email protected] mysql]# mysql
  105. Welcome to the MySQL monitor. Commands end with ; or \g.
  106. Your MySQL connection id is 1
  107. Server version: 5.6.36 MySQL Community Server (GPL)
  108.  
  109. Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
  110.  
  111. Oracle is a registered trademark of Oracle Corporation and/or its
  112. affiliates. Other names may be trademarks of their respective
  113. owners.
  114.  
  115. Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.
  116.  
  117. mysql> show databases
  118.     -> ;
  119. +--------------------+
  120. | Database |
  121. +--------------------+
  122. | information_schema |
  123. | mysql |
  124. | performance_schema |
  125. | test |
  126. +--------------------+
  127. 4 rows in set (0.01 sec)
  128.  
  129. mysql> quit
  130. Bye

以上是关于使用rpm安装mysql5.6(简单安装 实验使用)的主要内容,如果未能解决你的问题,请参考以下文章

centos RPM方式安装MySQL5.6

linux下mysql5.6 rpm包安装

MySQL5.6安装(RPM)笔记

RPM方式安装MySQL5.6

无外网情况下RPM方式安装MySQL5.6

RPM方式安装MySQL5.6