阿里云Centos7使用yum安装MySQL5.6的正确姿势

[root@iZuf67u6816pmg3fc1bx5fZ ~]# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Retrieving http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:mysql-community-release-el7-5    ################################# [100%]
[root@iZuf67u6816pmg3fc1bx5fZ ~]# yum repolist enabled | grep "mysql.*-community.*"
mysql-connectors-community/x86_64 MySQL Connectors Community                  42
mysql-tools-community/x86_64      MySQL Tools Community                       51
mysql56-community/x86_64          MySQL 5.6 Community Server                 344
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]# yum -y install mysql-community-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.37-2.el7 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.37-2.el7 for package: mysql-community-server-5.6.37-2.el7.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.37-2.el7.x86_64
--> Processing Dependency: perl(Data::Dumper) for package: mysql-community-server-5.6.37-2.el7.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.37-2.el7.x86_64
--> Running transaction check
---> Package mariadb.x86_64 1:5.5.52-1.el7 will be obsoleted
---> Package mysql-community-client.x86_64 0:5.6.37-2.el7 will be obsoleting
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.37-2.el7.x86_64
---> Package mysql-community-common.x86_64 0:5.6.37-2.el7 will be installed
---> Package perl-DBI.x86_64 0:1.627-4.el7 will be installed
--> Processing Dependency: perl(RPC::PlServer) >= 0.2001 for package: perl-DBI-1.627-4.el7.x86_64
--> Processing Dependency: perl(RPC::PlClient) >= 0.2000 for package: perl-DBI-1.627-4.el7.x86_64
---> Package perl-Data-Dumper.x86_64 0:2.145-3.el7 will be installed
--> Running transaction check
---> Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be obsoleted
---> Package mysql-community-libs.x86_64 0:5.6.37-2.el7 will be obsoleting
---> Package perl-PlRPC.noarch 0:0.2020-14.el7 will be installed
--> Processing Dependency: perl(Net::Daemon) >= 0.13 for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Test) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Net::Daemon::Log) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Processing Dependency: perl(Compress::Zlib) for package: perl-PlRPC-0.2020-14.el7.noarch
--> Running transaction check
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Zlib) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-Net-Daemon.noarch 0:0.48-5.el7 will be installed
--> Running transaction check
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================================================
 Package                                   Arch                     Version                          Repository                           Size
===============================================================================================================================================
Installing:
 mysql-community-client                    x86_64                   5.6.37-2.el7                     mysql56-community                    19 M
     replacing  mariadb.x86_64 1:5.5.52-1.el7
 mysql-community-libs                      x86_64                   5.6.37-2.el7                     mysql56-community                   2.0 M
     replacing  mariadb-libs.x86_64 1:5.5.52-1.el7
 mysql-community-server                    x86_64                   5.6.37-2.el7                     mysql56-community                    59 M
Installing for dependencies:
 mysql-community-common                    x86_64                   5.6.37-2.el7                     mysql56-community                   257 k
 perl-Compress-Raw-Bzip2                   x86_64                   2.061-3.el7                      base                                 32 k
 perl-Compress-Raw-Zlib                    x86_64                   1:2.061-4.el7                    base                                 57 k
 perl-DBI                                  x86_64                   1.627-4.el7                      base                                802 k
 perl-Data-Dumper                          x86_64                   2.145-3.el7                      base                                 47 k
 perl-IO-Compress                          noarch                   2.061-2.el7                      base                                260 k
 perl-Net-Daemon                           noarch                   0.48-5.el7                       base                                 51 k
 perl-PlRPC                                noarch                   0.2020-14.el7                    base                                 36 k

Transaction Summary
===============================================================================================================================================
Install  3 Packages (+8 Dependent packages)

Total download size: 82 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mysql56-community/packages/mysql-community-common-5.6.37-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Public key for mysql-community-common-5.6.37-2.el7.x86_64.rpm is not installed
(1/11): mysql-community-common-5.6.37-2.el7.x86_64.rpm                                                                  | 257 kB  00:00:00
(2/11): mysql-community-libs-5.6.37-2.el7.x86_64.rpm                                                                    | 2.0 MB  00:00:01
(3/11): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm                                                                  |  32 kB  00:00:00
(4/11): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm                                                                   |  57 kB  00:00:00
(5/11): perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                         |  47 kB  00:00:00
(6/11): perl-IO-Compress-2.061-2.el7.noarch.rpm                                                                         | 260 kB  00:00:00
(7/11): perl-Net-Daemon-0.48-5.el7.noarch.rpm                                                                           |  51 kB  00:00:00
(8/11): perl-PlRPC-0.2020-14.el7.noarch.rpm                                                                             |  36 kB  00:00:00
(9/11): perl-DBI-1.627-4.el7.x86_64.rpm                                                                                 | 802 kB  00:00:00
(10/11): mysql-community-client-5.6.37-2.el7.x86_64.rpm                                                                 |  19 MB  00:00:07
(11/11): mysql-community-server-5.6.37-2.el7.x86_64.rpm                                                                 |  59 MB  00:00:16
-----------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                          4.2 MB/s |  82 MB  00:00:19
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
 Userid     : "MySQL Release Engineering <mysql-build@oss.oracle.com>"
 Fingerprint: a4a9 4068 76fc bd3c 4567 70c8 8c71 8d3b 5072 e1f5
 Package    : mysql-community-release-el7-5.noarch (installed)
 From       : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : mysql-community-common-5.6.37-2.el7.x86_64                                                                                 1/13
  Installing : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                        2/13
  Installing : mysql-community-libs-5.6.37-2.el7.x86_64                                                                                   3/13
  Installing : mysql-community-client-5.6.37-2.el7.x86_64                                                                                 4/13
  Installing : perl-Net-Daemon-0.48-5.el7.noarch                                                                                          5/13
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                6/13
  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                 7/13
  Installing : perl-IO-Compress-2.061-2.el7.noarch                                                                                        8/13
  Installing : perl-PlRPC-0.2020-14.el7.noarch                                                                                            9/13
  Installing : perl-DBI-1.627-4.el7.x86_64                                                                                               10/13
  Installing : mysql-community-server-5.6.37-2.el7.x86_64                                                                                11/13
  Erasing    : 1:mariadb-5.5.52-1.el7.x86_64                                                                                             12/13
  Erasing    : 1:mariadb-libs-5.5.52-1.el7.x86_64                                                                                        13/13
  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                                                                                 1/13
  Verifying  : perl-Data-Dumper-2.145-3.el7.x86_64                                                                                        2/13
  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                                                                                        3/13
  Verifying  : mysql-community-libs-5.6.37-2.el7.x86_64                                                                                   4/13
  Verifying  : mysql-community-common-5.6.37-2.el7.x86_64                                                                                 5/13
  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                                                                                6/13
  Verifying  : mysql-community-server-5.6.37-2.el7.x86_64                                                                                 7/13
  Verifying  : perl-Net-Daemon-0.48-5.el7.noarch                                                                                          8/13
  Verifying  : perl-DBI-1.627-4.el7.x86_64                                                                                                9/13
  Verifying  : mysql-community-client-5.6.37-2.el7.x86_64                                                                                10/13
  Verifying  : perl-PlRPC-0.2020-14.el7.noarch                                                                                           11/13
  Verifying  : 1:mariadb-5.5.52-1.el7.x86_64                                                                                             12/13
  Verifying  : 1:mariadb-libs-5.5.52-1.el7.x86_64                                                                                        13/13 

Installed:
  mysql-community-client.x86_64 0:5.6.37-2.el7    mysql-community-libs.x86_64 0:5.6.37-2.el7    mysql-community-server.x86_64 0:5.6.37-2.el7   

Dependency Installed:
  mysql-community-common.x86_64 0:5.6.37-2.el7   perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7   perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
  perl-DBI.x86_64 0:1.627-4.el7                  perl-Data-Dumper.x86_64 0:2.145-3.el7          perl-IO-Compress.noarch 0:2.061-2.el7
  perl-Net-Daemon.noarch 0:0.48-5.el7            perl-PlRPC.noarch 0:0.2020-14.el7             

Replaced:
  mariadb.x86_64 1:5.5.52-1.el7                                       mariadb-libs.x86_64 1:5.5.52-1.el7                                      

Complete!
[root@iZuf67u6816pmg3fc1bx5fZ ~]# systemctl enable mysqld
[root@iZuf67u6816pmg3fc1bx5fZ ~]# systemctl start mysqld
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
 ... Failed!  Not critical, keep moving...
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Cleaning up...
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]#
[root@iZuf67u6816pmg3fc1bx5fZ ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 5.6.37 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, 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 |
+--------------------+
3 rows in set (0.00 sec)

mysql> 

 

http://www.cnblogs.com/XBlack/p/5178758.html

 

时间: 2024-08-31 01:59:35

阿里云Centos7使用yum安装MySQL5.6的正确姿势的相关文章

阿里云教你开万人大会的正确姿势

怎样开好一场万人大会? 在今天的正文开始之前,让我们先来看几张照片. 看到这里,估计不少网友会呲之以鼻:"这算什么,要知道咱们中国人见多识广,这种场面早就见得多了,比起那些歪果仁不知道高到哪里去了!" "这明明就是明星演唱会嘛!要不就是春运时的火车站!" 然而并没有,这其实是上周在杭州云栖小镇召开的2015阿里云栖大会. 与2014年云栖大会的8000人规模相比,今年的云栖大会参会者达到了史无前例的24000多人. 作为一场云计算的盛会,这个数字甚至超过了前不久在大

阿里云Centos7安装LNMP+wordpress_Linux

1. 安装Nginx #yum install nginx #配置文件处于/etc/nginx #systemctl start nginx #启动nginx #systemctl enable nginx.service # 设置为开机启动 #systemctl status firewalld #检查防火墙,如果为active (running),则 #vim /etc/firewalld/zones/public.xml # 在zone <zone> - <service name

如何在阿里云Centos7.0上配置java web环境

如何在阿里云Centos7.0上配置java web环境 1.下载Xshell和xftp 把这两个工具传CSDN上了. 2.连接到阿里云服务器 把下载的工具安装到电脑上,然后打开xshell,配置连接,主机就是阿里云服务器的公网IP,连接到阿里云服务器. 3.上传安装文件 点击图片标注菜单,然后就可以打开Xftp软件,连接到服务器,进行文件上传和下载. 4.安装上传的文件 通过cd命令切换到上传的文件夹,执行rpm-ivhjdk-8u60-linux-x64.rpm命令进行安装Javajdk,r

CentOS 6.5下yum安装 MySQL-5.5全过程图文教程_Mysql

在linux安装mysql是一个困难的事情,yum安装一般是安装的mysql5.1,现在经过自己不懈努力终于能用yum安装mysql5.5了.下面通过两种方法给大家介绍CentOS 6.5下yum安装 MySQL-5.5全过程,一起学习吧. 方法一: 具体方法和步骤如下所示: 1.第一步就是看linu是否安装了mysql,经过rpm -qa|grep mysql查看到centos下安装了mysql5.1,那就开始卸载咯 2.接下来就是卸载mysql5.1了,命令:rpm -e mysql-lib

阿里云CentOS7安装Mongodb教程_MongoDB

一.概述 近日要在新的CentOS系统上安装MongoDB,某度结果后直接从Mongo官网直接获得3.2版本的下载链接,结果在下载时发觉速度慢的可怜.迫于无奈,只能找国内的镜像下载.切换国内的安装源后,使用yum的方式安装后发现,安装的MongoDB版本居然是2.8的.一番研究后,贴出以下操作方式,提供给后人操作. 二.操作过程 1.首先更新一下包吧,多更无害. sudo yum -y update 2.在/etc/yum.repos.d 创建一个 mongodb-org.repo 文件 sud

阿里云centos7 安装nginx

1.添加yum源(参考官方文档)To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents: [nginx] name=nginx repo baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/ gpgcheck=0 enabled=1 Replac

阿里云CentOS 6.5 安装Docker详细步骤_docker

因为阿里云的CentOS 6.5版本默认内核kernel版本是2.6的,比较低.安装docker的后,运行不了. 步骤: 1.使用命令更新: yum update 2.安装Docker.这里忽略500字.... 3.使用命令查看IP: ifconfig 将看到有类似的结果: eth0 Link encap:Ethernet HWaddr 00:16:3E:00:6B:5D inet addr:10.169.127.193 Bcast:10.169.127.255 Mask:255.255.248

阿里云服务器window版安装解压免安装版mysql,出现系统错误2:系统无法找到指定文件

问题描述 在阿里云服务器中,系统为windowsServer2012安装解压版mysql,版本为mysql-5.7.11-winx64.ini配置文件中有修改为控制台中在指定目录中输入相应命令后出现系统环境变量Path中也添加了对应的路径,请大神帮忙解决

[教程]阿里云弹性Web托管安装Discuz图文教程

前言: 弹性Web托管:阿里云推出的新一代建站主机,基于先进的容器技术架构,资源隔离性好,且具有攻击隔离能力,更稳定.安全,带配套控制面板,管理体验同虚机一样简单. 价格从20元-90元每月.在刚刚推出弹性web托管的时候我就出了一个视频教程:"WM云建站"系列视频课程--如何在弹性web上搭建discuz和wordpress站点  如果你认真看教程的话可以略过本帖子,因为视频里面完整的交代了流程. 背景:  计划每月出两个原创教程,我这是压着黄线按时完成任务. 视频看着详细.不过对于