数据库

一、Mariadb 简介

数据库是指长期存储在计算机内、有组织的和可共享的数据集合。表是数据库存储数据的基本单位,一个表由若干个字段组成

  • MariaDB 数据库管理系统是 MySQL 的一个分支,主要由开源社区在维护,采用 GPL 授权许可 MariaDB 的目的是完全兼容
    MySQL ,包括 API 和命令行,是 MySQL 的代替品
  • MariaDB 由 MySQL 的创始人 Michael Widenius 主导开发,他早前曾以 10 亿美元的价格,将自己创建的公司
    MySQL AB 卖给了 SUN
  • 随着SUN 被甲骨文收购, MySQL 的所有权也落入 Oracle 的手中
  • MariaDB 名称来自 Michael Widenius 的女儿 Maria 的名字

二、Mariadb的安装和安全初始化

1.安装

[root@localhost ~]# yum install mariadb-server.x86_64 -y
[root@localhost ~]# systemctl start mariadb
  • 1   yum install mariadb-server.x86_64
  • 2  systemctl  restart mariadb

2.安全初始化
【1】关闭网络接口
数据库的网络接口默认是打开的,安全起见需要关闭接口

vim /etc/my.cnf增加一行skip-networking=1

重启数据库服务之后。3306网络端口关闭

 


【2】安全初始化

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.

Set root password? [Y/n]  ##设置root密码
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.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值