Linux安装MySQL5.6报错,可按下方操作一块操作下,最后就成功安装上并可免密访问MySQL了
※※※※※※※※※※※※※※※※※※ 安装mysql-server报错 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# rpm -ivh MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
错误:依赖检测失败:
/usr/bin/perl 被 MySQL-server-5.6.27-1.linux_glibc2.5.x86_64 需要
※※※※※※※※※※※※※※※※※※ 查到的方法是这样,但不行 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# rpm -ivh --nodeps MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:MySQL-server-5.6.27-1.linux_glibc################################# [100%]
警告:用户mysql 不存在 - 使用root
警告:群组mysql 不存在 - 使用root
/var/tmp/rpm-tmp.AONZ84: /usr/bin/mysql_install_db: /usr/bin/perl: 坏的解释器: 没有那个文件或目录
※※※※※※※※※※※※※※※※※※ 继续查结果,安装 perl perl-devel ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# yum install -y perl perl-devel
# 等待安装完成
※※※※※※※※※※※※※※※※※※ 试图卸载先前不知是否安装成功的mysql-server ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# rpm -e MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm
错误:未安装软件包 MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm
※※※※※※※※※※※※※※※※※※ 再执行安装一下,后边自动升级,等待完成,没有报错 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# rpm -ivh MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
软件包 MySQL-server-5.6.27-1.linux_glibc2.5.x86_64 已经安装
※※※※※※※※※※※※※※※※※※ 再卸载,再安装 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# rpm -e MySQL-server-5.6.27-1.linux_glibc2.5.x86_64
[root@hadoop4 software]# rpm -ivh MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-server-5.6.27-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:MySQL-server-5.6.27-1.linux_glibc################################# [100%]
※※※※※※※※※※※※※※※※※※ 继续安装 mysql-client ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# rpm -ivh MySQL-client-5.6.27-1.linux_glibc2.5.x86_64.rpm
警告:MySQL-client-5.6.27-1.linux_glibc2.5.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID 5072e1f5: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:MySQL-client-5.6.27-1.linux_glibc################################# [100%]
※※※※※※※※※※※※※※※※※※ 启动MySQL服务,报错 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# service mysql start
Starting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/hadoop4.pid).
※※※※※※※※※※※※※※※※※※ 查到的是安装 perl-Data-Dumper ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# yum install -y perl-Data-Dumper
# 等待安装完成
※※※※※※※※※※※※※※※※※※ 启动MySQL服务,还是报错 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# service mysql start
Starting MySQL.. ERROR! The server quit without updating PID file (/var/lib/mysql/hadoop4.pid).
※※※※※※※※※※※※※※※※※※ 查到的执行下边命令 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# mysql_install_db --user=mysql --basedir=/usr/ --ldata=/var/lib/mysql/
# 等待执行结束,执行过程中有 OK Completed 等说明,没有相关报错的信息
※※※※※※※※※※※※※※※※※※ 再启动MySQL服务,成功了 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# service mysql start
Starting MySQL. SUCCESS!
※※※※※※※※※※※※※※※※※※ 查询状态,正常 ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# service mysql status
SUCCESS! MySQL running (20963)
※※※※※※※※※※※※※※※※※※ 进入MySQL ※※※※※※※※※※※※※※※※※※
[root@hadoop4 software]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.27 MySQL Community Server (GPL)
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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.02 sec)
mysql>