1.2. MariaDB

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:

http://mariadb.org/

1.2.1. CentOS YUM 安装 MariaDB

		
cat >> /etc/yum.repos.d/MariaDB.repo <<EOF
# MariaDB 5.5 CentOS repository list - created 2013-12-04 02:17 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/5.5/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
		
		
# yum search MariaDB | grep MariaDB
============================= N/S Matched: MariaDB =============================
MariaDB-Galera-server.x86_64 : MariaDB: a very fast and robust SQL database
MariaDB-client.x86_64 : MariaDB: a very fast and robust SQL database server
MariaDB-common.x86_64 : MariaDB: a very fast and robust SQL database server
MariaDB-compat.x86_64 : MariaDB: a very fast and robust SQL database server
MariaDB-devel.x86_64 : MariaDB: a very fast and robust SQL database server
MariaDB-server.x86_64 : MariaDB: a very fast and robust SQL database server
MariaDB-shared.x86_64 : MariaDB: a very fast and robust SQL database server
MariaDB-test.x86_64 : MariaDB: a very fast and robust SQL database server
		

安装数据库

# yum install -y MariaDB-server MariaDB-client
		

指定默认root密码

# mysqladmin -u root password 'chen'
		

数据库安全配置

# /usr/bin/mysql_secure_installation
/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, 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 MariaDB
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]
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]
 ... 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]
 ... 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]
 - 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]
 ... 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!
		

进入数据库

		
# mysql -uroot -pchen
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 5.5.34-MariaDB MariaDB Server

Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [mysql]>
		
		

使用上与MySQL并无差异

1.2.2. MariaDB Audit Plugin





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
缓存 关系型数据库 MySQL
MariaDB的安装与配置
MariaDB的安装与配置
1031 0
|
关系型数据库 MySQL Linux
MariaDB强制修改root密码
前几天装了个MariaDB数据库来代替mysql,结果密码太复杂 给忘了。进过百度搜索了几个办法后, 总结以下办法 1.修改配置文件 示例 在MariaDB安装目录下的找到配置文件my.
1947 0
|
关系型数据库 Linux 数据库
|
2月前
|
安全 Ubuntu 关系型数据库
MariaDB
【10月更文挑战第03天】
49 4
|
机器学习/深度学习 Oracle 安全
MariaDB Centos7 下安装MariaDB
MariaDB Centos7 下安装MariaDB
416 0
|
MySQL 关系型数据库 PHP
MariaDB 的安装与配置
这个是本人最早接触的一篇数据库配置,也是让我入门Linux基础环境搭建的一篇,有时候忘了命令也会参考里面的内容 # rpm -ivh 12-cmake-2.8.11.1-5.
1431 0
|
关系型数据库 MySQL 数据安全/隐私保护
Mariadb安装之后的各种设置
Mariadb安装之后的各种设置 1、启动MariaDB 安装完成MariaDB,首先启动MariaDB,两条命令都可以 systemctl start mariadb 或者 service mariadb start 设置开机启动 systemctl enable mariadb .
2019 0
|
存储 关系型数据库 MySQL
MariaDB / MySQL数据类型
MariaDB / MySQL 数据类型 有三种主要的类型:Text(文本)、Number(数字)和 Date/Time(日期/时间)类型。 Text 类型: 数据类型 描述 CHAR(size) 保存固定长度的字符串(可包含字母、数字以及特殊字符)。
1317 0
|
SQL 关系型数据库 MySQL
|
Ubuntu 关系型数据库 MySQL