运维笔记20 (mariaDB的基础语句)

随着Oracle对MySQL的闭源担忧,mariaDB作为其分支受到广泛关注。本文介绍了mariaDB的安装过程,特别是在RHEL7系统中,可以通过yum方便地安装mariadb rpm包。
摘要由CSDN通过智能技术生成

概述:LAMP架构盛极一时,这离不开MySQL的免费与易用,但是在Oracle收购了Sun之后,很多公司开始担忧MySQL的开源前景,而最近Oracle进一步闭源的举措更是让人难以安心,众多互联网公司纷纷开始寻求MySQL的替代方案。mariaDB原是mysql的一个分支,在mysql创始人加入后,更加吸引了大众的目光。

1.安装mariaDB

我们一直使用的RHEL7的自带yum源已经有了mariadb的rpm包,我们可以使用yum非常方便的安装。

[root@localhost dhcp]# yum install mariadb-server -y
[root@localhost dhcp]# yum list all | grep mariadb
mariadb-server.x86_64                    1:5.5.35-3.el7                rhel_dvd



但是yum提供的mariadb的版本实在是有点低,我们去看下mariadb官网。

官网上已经出了10.2.2的beta版本,不过人家可提示你了,不要在生产环境使用beta版。这篇博客的主要目的是对常用语句的总结,就先不尝试这个的源码安装了。

2.使用mariaDB

[root@localhost dhcp]# systemctl start mariadb
打开mariadb服务


skip-networking=1
修改mariadb配置文件使其跳过网络使用


[root@localhost dhcp]# 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): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
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] y
New password: 
进入数据库
[root@localhost dhcp]# mysql -uroot -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 11
Server ve
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值