安装教程
  1、下载mysql的repo源
   wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
可能遇见的问题:wget未找到命令

解决方案:yum -y install wget

2、安装mysql-community-release-el7-5.noarch.rpm包
       sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装完这个包后,会获得两个mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo。
       3、安装mysql
       sudo yum install mysql-server
安装完的配置
      1、加入开机启动
       systemctl enable mysqld
      2、启动mysql服务进程
       systemctl start mysqld
      3、重置密码
       [root@localhost ~]# 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):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
You already have a root password set, so you can safely answer ‘n’.
Change the root password? [Y/n] y [设置root用户密码]
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] n [禁止root远程登录]
… skipping.
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 [删除test数据库]
- 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…

4、授权远程登录
       (1)登录mysql数据库 Mysql -u root -p

(2)授权登录
  登录mysql之后执行
  GRANT ALL PRIVILEGS ON . TO ‘ROOT’@’%’ IDENTIFIED BY ‘PASSWORD’ WITH GRANT OPTION;(注:此处的password指的是root用户的密码)
  GRANT ALL PRIVILEGS ON . TO ‘ROOT’@’%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;

5、开放防火墙端口
       firewall-cmd –add-port=3306/tcp –permanent

6、重启防火墙
       service firewalld restart

---------------------
作者:王雅静-Cathy
来源:CSDN
原文:https://blog.csdn.net/wyj19950908/article/details/79684574
版权声明:本文为博主原创文章,转载请附上博文链接!

centos7最新 mysq5.6 安装的更多相关文章

  1. centos7.2下编译安装&&使用-git代码库

    centos7.2下编译安装git Git简介 Git是一个分布式版本控制系统 Git vs SVN SVN是典型的集中式版本控制起,版本库集中存放在服务器,当我们用自己的电脑干活儿的时候,需要先从中 ...

  2. [转]Centos7下caffe的安装

    Centos7下caffe的安装 原文地址:http://blog.csdn.net/s2392735818/article/details/49796017   版权声明:本文为博主原创文章,未经博 ...

  3. centos7中使用yum安装tomcat以及它的启动、停止、重启

    centos7中使用yum安装tomcat 介绍 Apache Tomcat是用于提供Java应用程序的Web服务器和servlet容器. Tomcat是Apache Software Foundat ...

  4. centos7系统下nginx安装并配置开机自启动操作

    准备工作 我的centos7系统是最小化安装的, 缺很多库, 首先安装必须的运行库 ? 1 2 3 4 5 6 7 8 9 10 11 yum install wget gcc gcc-c++ pcr ...

  5. CentOS7和Ubuntu下安装Docker & Docker-Compose

    本篇介绍如何在CentOS 7.6和Ubuntu 16.04下安装Docker & Docker-Compose. CentOS篇 安装Docker # cat /etc/redhat-rel ...

  6. Centos7源码编译安装PHP7.2(生产环境)

    安装PHP依赖包,否则在编译的过程中可能会出现各种报错 # Centos 安装epel-release源并将系统包更新到最新版本 $ yum install epel-release-y $ yum ...

  7. CentOS7使用tar方式安装Containerd,配置文件介绍

    主机:centos 7.9 下载 官网GitHub上下载地址:https://github.com/containerd/containerd/releases 问题: 创建容器后,运行的时候报错: ...

  8. centos7下使用yum安装mysql

    CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 wget http://repo.mysql.com/m ...

  9. 决战大数据之二:CentOS 7 最新JDK 8安装

    决战大数据之二:CentOS 7 最新JDK 8安装 [TOC] 修改hostname # hostnamectl set-hostname node1 --static # reboot now 重 ...

随机推荐

  1. HTTP认证之摘要认证——Digest(一)

    导航 HTTP认证之基本认证--Basic(一) HTTP认证之基本认证--Basic(二) HTTP认证之摘要认证--Digest(一) HTTP认证之摘要认证--Digest(二) 一.概述 Di ...

  2. 商品评分效果JavaScript

    <script> window.onload=function(){ //----------选中的星星会多出一个属性:isClick="true" 藉此来获取评分-- ...

  3. PHP的抽象类、接口的区别和选择

    1.对接口的使用是通过关键字implements.对抽象类的使用是通过关键字extends.当然接口也可以通过关键字extends继承. 2.接口中不可以声明成员变量(包括类静态变量),但是可以声明类 ...

  4. mybatis特殊字符处理

    在mybatis 的mapper.xml文件中特殊字符处理方式  仅供参考 出处:http://yaobenzhang.blog.163.com/blog/static/214395113201561 ...

  5. Gpfixup

    Updated: April 17, 2012 Applies To: Windows Server 2003, Windows Vista, Windows Server 2008, Windows ...

  6. pycharm许可证过期

    1.选择enter license 2.选择license server 3.输入http://idea.imsxm.com 4.点击ok 好,解决了

  7. Shell脚本编程

    1.linux中的变量 linux中的变量分为环境变量和普通变量,其中环境变量可以理解为全局变量,在所有shell的子程序中都可以引用,普通变量只能在自己的shell程序中使用,程序结束后变量无法保留 ...

  8. hnust 土豪金的加密解密

    问题 G: 土豪金的加密与解密 时间限制: 1 Sec  内存限制: 128 MB提交: 466  解决: 263[提交][状态][讨论版] 题目描述     有一位姓金的同学因为买了一部土豪金,从此 ...

  9. bat 处理adb脚本

    @echo off REM Funtion: 测试parsermode 接口CdxParserGetMediaInfo 和CdxParserRead REM Code by lzp 2017-05-0 ...

  10. 【转】Netty系列之Netty编解码框架分析

    http://www.infoq.com/cn/articles/netty-codec-framework-analyse/ 1. 背景 1.1. 编解码技术 通常我们也习惯将编码(Encode)称 ...