1:添加 MariaDB yum 仓库

vi /etc/yum.repos.d/MariaDB.repo
在该文件中添加以下内容保存:

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=

2:安装 MariaDB

yum install MariaDB-server MariaDB-client -y

(1)安装完毕后,立即启动数据库服务守护进程。

systemctl start mariadb

(2)设置 MariaDB 在操作系统重启后自动启动服务

systemctl enable mariadb

(3)查看 MariaDB 服务当前状态

systemctl status mariadb

3:对 MariaDB 进行安全配置

设置 MariaDB 的 root 账户密码,删除匿名用户,禁用 root 远程登录,删除测试数据库,重新加载权限表。

mysql_secure_installation

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success! By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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, MariaDB 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...
... Success!
- 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! Cleaning up... All done! If you've completed all of the above steps, your MariaDB
installation should now be secure. Thanks for using MariaDB!

4:基本配置

(1)设置数据库字母大小写不敏感

vi /etc/my.cnf.d/server.cnf

在[mysqld]下加上】
lower_case_table_names=

(2)设置MariaDB数据库默认编码

vi /etc/my.cnf.d/client.cnf
在[client]字段里加入
default-character-set=utf8 vi /etc/my.cnf.d/server.cnf
在[mysqld]字段里加入
character-set-server=utf8

(3)修改默认端口号3306修改为3366

vi /etc/my.cnf.d/client.cnf
在[client]字段修改
port= vi /etc/my.cnf.d/server.cnf
在[mysqld]字段里加入
port=

(4)修改最大连接数

vi /etc/my.cnf.d/server.cnf
[mysqld] 下面增加下面配置:
max_connections= 查看最大连接数
show variables like '%max_connections%';

(5)修改max_allowed_packet

vi /etc/my.cnf.d/server.cnf
[mysqld] 下面增加下面配置:
max_allowed_packet=16M

5:最后重启 MariaDB 配置生效

systemctl restart mariadb

centos7安装配置MariaDB10的更多相关文章

  1. Centos7安装配置gitlab

    Centos7安装配置gitlab 这篇文字我会介绍在Centos7上安装gitlab,配置gitlab的smtp,并且创建项目demo. sudo yum install openssh-serve ...

  2. Centos7安装配置Apache+PHP+Mysql+phpmyadmin

    转载自: Centos7安装配置Apache+PHP+Mysql+phpmyadmin 一.安装Apache yum install httpd 安装成功后,Apache操作命令: systemctl ...

  3. Centos7安装配置JDK8

    Centos7安装配置JDK8 一.准备工作 第一步,去甲骨文官网下载Jdk相应的版本,我这里下载的是jdk1.8. 第二步将你从官网上下载下来的jdk使用FTP工具上传到云服务器上的相应目录,我的是 ...

  4. centos7命令行和图形界面的相互切换(附centos7安装配置教程)

    一.最近安装了centos7,发现在命令行和图形界面的相互切换命令上,与centos以往版本有很大不同,先整理如下,加深记忆. 1,centos7默认安装后,跟其他版本一样,启动默认进入图形界面: 2 ...

  5. (转)Centos7安装配置NFS服务和挂载

    Centos7安装配置NFS服务和挂载 原文:https://www.u22e.com/601.html NFS简介 NFS(Network File System)即网络文件系统,是FreeBSD支 ...

  6. CentOS7 安装配置笔记

    CentOS7 安装配置笔记 1.通过镜像安装 CentOS7 ==============================* 使用 UltraISO 9.7 或者 rufus-3.5p 制作ISO的 ...

  7. Centos7安装配置jenkins(Tomcat)

    Centos7安装配置jenkins(Tomcat) 一.准备工作 1.1 安装JDK1.8 具体安装过程不在赘述. 1.2 下载jenkins的war包 jenkins官网下载地址:https:// ...

  8. CentOS7 安装配置rsync

    centos7自带rsync,今天简单记录下. rsync安装配置步骤 服务器端: 1.修改默认配置文件/etc/rsyncd.conf,该成如下: # /etc/rsyncd: configurat ...

  9. centos7安装配置zabbix4.0

    zabbix01    198.8.8.211    zabbix-server4.0 zabbix02    198.8.8.212    zabbix-agent4.0 一:zabbix服务端环境 ...

随机推荐

  1. reflow和repaint理解总结

    repaint就是重绘,reflow就是回流 严重性: 在性能优先的前提下,reflow的性能消耗要比repaint的大. 体现: repaint是某个dom元素进行重绘,reflow是整个页面进行重 ...

  2. Ofbiz项目学习——阶段性小结——插入数据

    一.通用插入操作 /** * * 编写一个服务createUomOneDemo, * 该服务的作用是在表Uom中增加一条记录,其中: * 字段uomId的值为“BaseLineProduct”. * ...

  3. 实现:创建/复制/移动文件API

    使用的API: 1.DeleteFile DeleteFileW( _In_ LPCWSTR lpFileName ); 2.CopyFile CopyFileW( _In_ LPCWSTR lpEx ...

  4. OpenCV 学习笔记(8)彩色图像RGB通道的分离、合并与显示

    https://blog.csdn.net/ZYTTAE/article/details/42234989 由于算法的需要,需要把彩色图像的R.G.B值分离出来,OpenCV中正好有split() 和 ...

  5. 03_vlan & access & trunk 口(数通华为)

    1. 网络拓扑: 2. SW1配置: 2.1 关闭设备调试信息:<Huawei>undo terminal monitor <Huawei>undo terminal debu ...

  6. ACM数据结构-单调栈、队列

    1.最大数 代码: #include <stdio.h> #include <memory.h> #include <math.h> #include <st ...

  7. cogs 944. [東方S3] 藤原妹红

    二次联通门 : cogs 944. [東方S3] 藤原妹红 /* cogs 944. [東方S3] 藤原妹红 最小生成树 + 树形dp 首先对原图跑最下生成树 后建出一棵树 在树上进行dp 先走到叶子 ...

  8. 云服务器搭建JDK+Tomcat+MySQL环境

    一.首先租赁一台云服务器(阿里云服务器或者腾讯云服务器) 其实可以在windows电脑上使用VMware workstation来安装虚拟机进行操作,毕竟云服务器低配也是很贵的.不过可以使用学生价去租 ...

  9. 如果用了flex去加一个箭头怎么让他剧中

    左边是做了一个flex:1 右边是span的display:inline-block样式 父元素 .search-car-arrow display flex align-items center' ...

  10. Mysql中联合索引的最左匹配原则(百度)

    创建联合索引时列的选择原则 经常用的列优先(最左匹配原则) 离散度高的列优先(离散度高原则) 宽度小的列优先(最少空间原则) 在Mysql建立多列索引(联合索引)有最左前缀的原则,即最左优先.如果我们 ...