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

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