原文:https://devops.profitbricks.com/tutorials/install-mysql-on-centos-7/

1.下载mysql

mysql官网选择适合的mysql版本(Red Hat Enterprise Linux 7 / Oracle Linux 7 for this tutorial) 点击 Download 。

右键复制No thanks, just start my download.的链接。

sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm

2.安装mysql

现在就可以用yum命令安装mysql了

yum -y install mysql-community-server

3.mysql的启动、重启、停止

systemctl start mysqld #启动mysql服务
systemctl restart mysqld #启动mysql服务
systemctl stop mysqld #停止mysql服务
systemctl enable mysqld #开机启动mysql服务
systemctl status mysqld #查看mysql服务运行状态

4. 初始化mysql

mysql_secure_installation#命令将帮你安全初始化mysql 

Set root password? [Y/n] Y

Remove anonymous users? [Y/n] Y

Disallow root login remotely? [Y/n] Y

Remove test database and access to it? [Y/n] Y

Reload privilege tables now? [Y/n] Y

5.防火墙设置

MySQL listens on TCP port 3306 by default.

If the CentOS firewall is enabled, then a rule allowing access to the MySQL server on port 3306/tcp from host192.0.2.10 can be added.

firewall-cmd --permanent --zone=trusted --add-source=192.0.2.10/
firewall-cmd --permanent --zone=trusted --add-port=/tcp
firewall-cmd --reload

6.创建数据库用户

The following steps will describe creating a new database named appdb and granting the appuser full access to the new database.

Adjust the hostname from which the user will be connecting and password as necessary.

mysql> create database appdb;
mysql> grant all on appdb.* to 'appuser'@'localhost' identified by 'password';
mysql> quit

Install MySQL on CentOS 7的更多相关文章

  1. How to Install MySQL on CentOS 7

    CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载   # wget http://dev.mysql.com/get/mysql-communit ...

  2. Install MySql on CentOS

    Installing & Configuring MySQL Server This Howto will show you how to install MySQL 5.x, start t ...

  3. yum install mysql on centos 6.5 zz

    http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 1.使用yum命令进行mysql的安装 yum list ...

  4. How to install MySQL on CentOS

    1)chekc centos中是否安装了MySQL [root@localhost MySQL]# rpm -qa | grep mariadb mariadb-libs-5.5.52-1.el7.x ...

  5. Install Apache, PHP And MySQL On CentOS 7 (LAMP)

    This tutorial shows how you can install an Apache2 webserver on a CentOS 7.0 server with PHP5 suppor ...

  6. Install MySQL 5.7 on Fedora 25/24, CentOS/RHEL 7.3/6.8/5.11

    MySQL is a relational database management system (RDBMS) that runs as a server providing multi-user ...

  7. yum mysql on centos 7

    参考:https://www.linode.com/docs/databases/mysql/how-to-install-mysql-on-centos-7 centos 7上没有办法使用yum i ...

  8. Mysql之CentOS初探

    1. 卸载mysql 查看CentOS是否已经安装mysql数据库 rpm -qa | grep mysqlrpm -qa | grep MySQL 如果有,则卸载 // --nodeps表示强制rp ...

  9. How to install cacti on centos 6

    Cacti – Network and performance monitoring tool   Cacti is one of best monitoring tool used to monit ...

随机推荐

  1. [JavaEE]设计模式之SOLID原则

    1. S  The Single Responsibility Principle  单一责任原则 当需要修改某个类的时候原因有且只有一个(THERE SHOULD NEVER BE MORE THA ...

  2. 【Beta】Daily Scrum

    队名:Clover 解宇虹 031402338 林 锦 031402339 李坤隆 031402612 李烈争 031402614 林昊斌 031402615 林瑞斌 031402617 github ...

  3. [转]js获取域名、url、url参数值

    //获取域名host1 = window.location.host;host2 = document.domain; //获取页面完整地址url = window.location.href; 获取 ...

  4. 纯js+css实现loading等待效果

    此插件是基于jqueryUI的widget,下面是具体实现代码 第一部分css: /***loading***/ .loading-box{ position:absolute; text-align ...

  5. Container View 使用小技巧

    一.传值,顺传 -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { TVC *vc = segue.destin ...

  6. xml格式的数据转化成数组

    将得到的xml格式的数据转化成数组 <?php //构造xml $url = "http://api.map.baidu.com/telematics/v3/weather?locat ...

  7. 短信接口API

    /** * Created by bingone on 15/12/16. */ import org.apache.http.HttpEntity; import org.apache.http.N ...

  8. PHP慢脚本日志和Mysql的慢查询日志

    1.PHP慢脚本日志 间歇性的502,是后端 PHP-FPM 不可用造成的,间歇性的502一般认为是由于 PHP-FPM 进程重启造成的. 在 PHP-FPM 的子进程数目超过的配置中的数量时候,会出 ...

  9. Daily Scrum Meeting ——ThirdDay

    一.Daily Scrum Meeting照片 二.Burndown Chart 三.项目进展 1.完成了github上的文档整理 Transcend/ActivityHelper 2.主界面侧滑框的 ...

  10. javascript数据结构-介绍

    github博客地址 名词解释 数据结构是计算机存储.组织数据的方式.数据结构是指相互之间存在一种或多种特定关系的数据元素的集合.通常情况下,精心选择的数据结构可以带来更高的运行或者存储效率.数据结构 ...