官网下载安装mysql-server

# wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install mysql-community-server

安装成功后重启mysql服务。

# service mysqld restart

初次安装mysql,root账户没有密码。

[root@yl-web yl]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26 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.01 sec) mysql>

设置密码

mysql> set password for 'root'@'localhost' =password('password');
Query OK, 0 rows affected (0.00 sec) mysql>

不需要重启数据库即可生效。

在mysql安装过程中如下内容:

Installed:
  mysql-community-client.x86_64 0:5.6.26-2.el7                mysql-community-devel.x86_64 0:5.6.26-2.el7                
  mysql-community-libs.x86_64 0:5.6.26-2.el7                  mysql-community-server.x86_64 0:5.6.26-2.el7                Dependency Installed:
  mysql-community-common.x86_64 0:5.6.26-2.el7                                                                             Replaced:
  mariadb.x86_64 1:5.5.41-2.el7_0          mariadb-devel.x86_64 1:5.5.41-2.el7_0   mariadb-libs.x86_64 1:5.5.41-2.el7_0  
  mariadb-server.x86_64 1:5.5.41-2.el7_0 

三、配置mysql

1、编码

mysql配置文件为/etc/my.cnf

最后加上编码配置

[mysql]
default-character-set =utf8

这里的字符编码必须和/usr/share/mysql/charsets/Index.xml中一致。

2、远程连接设置

把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户。

mysql> grant all privileges on *.* to root@'%'identified by 'password';

如果是新用户而不是root,则要先新建用户

mysql>create user 'username'@'%' identified by 'password';  

此时就可以进行远程连接了。

防火墙配置

防火墙设置一下,不然3306端口还是无法访问。

1 iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

设置完之后,查看一下是否能通过。

1 iptables -L -n

如果想要限制访问。

iptables -D INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

OK,这样就可以远程访问了。

来源:https://www.cnblogs.com/starof/p/4680083.html

centos7 mysql-server 安装过程的更多相关文章

  1. 19.CentOS7下PostgreSQL安装过程

    CentOS7下PostgreSQL安装过程 装包 sudo yum install postgresql-server postgresql-contrib 说明: 这种方式直接明了,其他方法也可以 ...

  2. CentOS7离线安装Mysql(详细安装过程)

    Mysql安装 下载mysql离线安装包 https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.27-1.el7.x86_64.rpm-bundle ...

  3. centos7 mysql的安装

    本文记录centos7安装mysql的一些过程与遇到的一些坑 下载mysql的压缩包,直接从官网上面下载,链接:http://dev.mysql.com/downloads/mysql/ 选择 MyS ...

  4. centos7 mysql数据库安装和配置

    一.系统环境 yum update升级以后的系统版本为 [root@yl-web yl]# cat /etc/redhat-release CentOS Linux release 7.1.1503 ...

  5. (转)linux下mysql的安装过程

    最近在linux安装了mysql,根据网上收集的资料和个人的操作过程,大概做了个整理,以便以后进行参考回顾. 1.下载mysql-5.1.36.tar.gz,并且解压. tar -xzvf mysql ...

  6. centos7 mysql数据库安装和配置(转, 未验证)

    一.系统环境 yum update升级以后的系统版本为 [root@yl-web yl]# cat /etc/redhat-release CentOS Linux release 7.1.1503 ...

  7. MySQL详细安装过程

    目录 一.概述 二.MySQL安装 三.安装成功验证 四.NavicatforMySQL下载及使用 一.概述 MySQL版本:5.7.17 下载地址:http://rj.baidu.com/soft/ ...

  8. MySQL的安装过程

     近期对MySQL做了一些研究. 曾经主要接触的是SQL SERVER.所以,今天对该安装过程做了一些总结以及使用过程中的一些心得.并分享给大家. 记得前面.分享过一篇关于数据库的几种连接方式.而 ...

  9. CentOS7 MySql数据库安装配置(单实例)

    一. 安装mysql-server 官网下载安装 # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm # ...

  10. 安装解压版本的MySQL,安装过程中的常见命令,检查windows系统错误日志的方式来检查MySQL启动错误,关于Fatal error: Can't open and lock privilege

     以端口 port = 3306 # 设置mysql的安装目录 basedir=D://Installed//mysql-5.6.26-winx64//mysql-5.6.26-winx64 # ...

随机推荐

  1. 常用Mac快捷键

    1.复制Cmd + C 粘贴Cmd + C —-> Cmd + V 剪切Cmd + C —-> Cmd + Opt + V 2.查看隐藏文件 Cmd + shift + . 3. 货币符号 ...

  2. indexOf刚开始写成IndexOf出错

    {{# if(d.fronturlmin ==null||d.fronturlmin ==""){ }} <img src="@System.Configurati ...

  3. Lodop提示安装或升级的注意事项

    LODOP的LodopFuncs.js文件里,自动判断浏览器类型提示下载哪个,根据版本号比较判断提示升级.此文章是以前写的,图示可能过旧,新版提示不同,但是LodopFuncs.js里各个方面变动不大 ...

  4. 离线安装Python包hickle,easydict

    安装hickle source: https://github.com/telegraphic/hickle 1. cd to your downloaded hickle directory 2.  ...

  5. Ubuntu开发用新机安装流程

    1.SSH安装 Ubuntu缺省已安装客户端,此处安装服务端 sudo apt-get install openssh-server 确认sshserver是否启动 netstat -tlp | gr ...

  6. BZOJ3144[Hnoi2013]切糕——最小割

    题目描述 输入 第一行是三个正整数P,Q,R,表示切糕的长P. 宽Q.高R.第二行有一个非负整数D,表示光滑性要求.接下来是R个P行Q列的矩阵,第z个 矩阵的第x行第y列是v(x,y,z) (1≤x≤ ...

  7. BZOJ3196二逼平衡树——线段树套平衡树(treap)

    此为平衡树系列最后一道:二逼平衡树您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作: 1.查询k在区间内的排名2.查询区间内排名为k的值3.修改某一位值上的数值4.查询 ...

  8. Matplotlib学习---用matplotlib画面积图(area chart)

    这里利用Nathan Yau所著的<鲜活的数据:数据可视化指南>一书中的数据,学习画图. 数据地址:http://book.flowingdata.com/ch05/data/us-pop ...

  9. 【CTSC2017】【BZOJ4903】吉夫特 卢卡斯定理 DP

    题目描述 给你一个长度为\(n\)的数列\(a\),求有多少个长度\(\geq 2\)的不上升子序列\(a_{b_1},a_{b_2},\ldots,a_{b_k}\)满足 \[ \prod_{i=2 ...

  10. Failed to load package MonoAndroidDesignerPackage

    from : https://developercommunity.visualstudio.com/content/problem/160124/failed-to-load-package-mon ...