安装教程
  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. 配置Spring.NET

    先引入关键的程序集 Common.Logging.dll Spring.Core.dll 在配置文件配置中: <configSections> ...... <sectionGrou ...

  2. TCP/IP网络编程之I/O复用

    基于I/O复用的服务端 在前面章节的学习中,我们看到了当有新的客户端请求时,服务端进程会创建一个子进程,用于处理和客户端的连接和处理客户端的请求.这是一种并发处理客户端请求的方案,但并不是一个很好的方 ...

  3. luoguT30204 偷上网

    \(n=1\) 时特判四角,其余时刻圆的面积和必小于正方形面积,随机点出来判断就行了. stm 随机算法-- #include <iostream> #include <cstdli ...

  4. BMP图片的加载方式:资源 VS 文件

    在程序中加载位图有很多方法,各有各的好处.这里简单说一下在资源里和文件里加载的区别. 第一.在资源里加载位图 这种方法就是在工程里的“资源视图”-->“添加资源”-->"Bitm ...

  5. MOCTF-火眼金睛

    MOCTF-火眼金睛 http://119.23.73.3:5001/web10/ 把这个题目当作python爬虫来练习. 首先要获取到文本框里面的全部信息, import requests impo ...

  6. 踩坑 Uncaught RangeError: Maximum call stack size exceeded

    今天遇到了一个错误, 堆栈溢出,很好奇就是一个简单ajax请求怎么会报这个错误,研究了一下,发现犯了一个很低级的错误,data的参数错误了: passWord是未定义的变量,值为空,然后导致了这个问题 ...

  7. hnust 土豪金的加密解密

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

  8. caffe工程配置问题

    一开始是碰到没有caffe/caffe.hpp文件的问题,不知道怎么弄.通过百度,知道了在makefile文件里加入头文件路径和库文件路径就行. 首先是caffe.pb.h丢失问题,解决方法:http ...

  9. 微信小程序--问题汇总及详解之form表单

    附上微信小程序开发文档链接:https://mp.weixin.qq.com/debug/wxadoc/dev/framework/MINA.html form表单: 当点击 <form/> ...

  10. http状态码相关知识(复制)

    HTTP报文是面向文本的,报文中的每一个字段都是一些ASCII码串,各个字段的长度是不确定的.HTTP有两类报文:请求报文和响应报文. HTTP请求报文 一个HTTP请求报文由请求行(request ...