Mysql的基础使用之MariaDB安装方法详解
作者:AdapterCat 发布时间:2024-01-14 15:03:46
标签:mysql,mariadb,安装
我首次用mysql是在ubuntu上,现在用的是linux 中的Red Hat 分支的centOS 7 ,安装时发现通常用的都是MariaDB 来代替mysql,通过资料查询发现Mariadb是mysql的其中的一种分支,由mysql的创始人带领的团队所开发的mysql分支的一种版本,因为mysql受到被Oracle收购后的日渐封闭与缓慢的更新,众多Linux发行版逐渐抛弃了这个人气开源数据库,使MySQL在各大Linux发行版中的失势由于不满MySQL被Oracle收购后的日渐封闭与缓慢的更新,众多Linux发行版逐渐抛弃了这个人气开源数据库,而转向了MariaDB,虽然PostgreSQL一直被当作MySQL的直接竞争对手,然而真正给予其致命一击的似乎更像是MariaDB,而以后给Mysql致命一击的也将是MariaDB。
言归正传,我们来具体讲讲MariaDB ,其实MariaDb的操作与Mysql的操作基本一样,只是基于Mysql进行了性能的提升,目前MariaDB的更新速度已经远远超越了Oracle团队的速度,毕竟是Mysql创始人带领的团队,怎么不让人放心。
MariaDb的安装
linux下 通过
yum install mariadb mariadb-server #询问是否要安装,输入Y即可自动安装
mariaDBde 服务的基本命令
[root@127 ~]# systemctl start mariadb.service #启动MariaDB
[root@127 ~]# systemctl stop mariadb.service #停止MariaDB
[root@127 ~]# systemctl restart mariadb.service #重启MariaDB
[root@127 ~]# systemctl enable mariadb.service #设置开机自动启动 [root@127 ~]# systemctl disenable mariadb.service #设置开机自启关闭
初始化root密码
[root@127 ~]# mysql_secure_installation #为初始化账户root添加密码
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):这里填写root密码,如果是第一次初始化密码为空直接敲回车(回车前)
Enter current password for root (enter for none):这里填写root密码,如果是第一次初始化密码为空直接敲回车 (回车后↓)
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] 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...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- 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!# 这里表示修改密码成功
数据库登录
[root@127 ~]# mysql -uroot -proot #mysql -u这里是填写的用户名(默认为root) &我是空格& -p这里填写的是密码(默认为空)
这表示已经进入MariaDBWelcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 23
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
# 通过/h可以查看很多命令
MariaDB [(none)]> 这里是输入sql语句的入口
以上是MariaDB的安装
以上所述是小编给大家介绍的Mysql的基础使用之MariaDB安装方法详解网站的支持!
来源:http://www.cnblogs.com/AdaterCat/archive/2016/09/07/5850700.html


猜你喜欢
- 本文实例讲述了Python面向对象程序设计之类和对象、实例变量、类变量用法。分享给大家供大家参考,具体如下:类和对象:类的定义:用来描述具有
- 桥接模式(Bridge Pattern)是什么桥接模式是一种结构型模式,它将抽象部分与实现部分分离开来,使它们可以独立地变化。在桥接模式中,
- 条件查询范围查询模糊查询条件查询all()返回全部结果集filter(**kwargs)返回满足参数定义的结果集 例如Entry.objec
- 本文实例为大家分享了python实现贪吃蛇双人大战的具体代码,供大家参考,具体内容如下晚上家里小朋友要玩贪吃蛇游戏,还要跟我对战,一时半会我
- 浏览器的开发者在很早的时候就已经意识到, HTTP's 的无状态会对Web开发者带来很大的问题,于是(cookies)应运而生。 c
- 本篇阅读的代码片段来自于30-seconds-of-python。1、average_bydef average_by(lst, fn=la
- 简单asp加载access数据库,并生成XML,然后再将XML数据加载进LIST组件范例学习。演示:http://www.taoshaw.c
- python嵌套函数使用外部函数变量的方法,Python2和Python3均可使用python3 def b(): b = 1 def bc
- 近期,有小伙伴问我关于怎么使用python进行散点图的绘制,这个东西很简单,但是怎么讲相关性的值标注在图形上略显麻烦,因此,在这里记录一下,
- 本文实例为大家分享了Python制作简易计算器的具体代码,供大家参考,具体内容如下简易计算器简易计算器功能:实现输入,计算,输出功能;可以计
- 在深度学习的数据训练过程中,虽然tensorflow和pytorch都会自带打乱数据进行训练的方法,但是当我们自己生成数据,或者某些情况下依
- public static char doVerify(String id) { char pszSrc[]=id.toCharArray(
- 本文介绍使用aspjpeg组件实现图片的半透明描边的效果,描边效果演示:参数说明'big 原图路径(相对)'small 生成
- 我们通常所说的DML、DDL、DCL语句都是sql*plus语句,它们执行完后,都可以保存在一个被称为sql buffer的内存区域中,并且
- 简单使用看w3school 里面没有参数调用, 例子如下 <script type="text/javascript&quo
- 数据归一化是深度学习数据预处理中非常关键的步骤,可以起到统一量纲,防止小数据被吞噬的作用。一:归一化的概念归一化就是把所有数据都转化成[0,
- 利用Python + wxpy 可以快速的查询自己好友的地区分布情况,以及好友的性别分布数量。还可以批量下载好友的头像,拼接成大图。本次教程
- excel转置分为两种情况,一个是较为简单的只需要行转列,列转行最简单的转置,利用pandas里面的转置**.T**函数代码如下:impor
- 自从腾讯微博上线以来,基本上就开始用了,一直到现在,作为一个开发人员,也看到了腾讯微博一直在不停的改变,也不知道大家有没有发现,腾讯微博提供
- 今天在群里,熊猫君提议整理一个帖子,一方面为初学者提供一个入门指南,另一方面也象借此和已经在从事这个行业进行一点交流。下面是我从事这个行当多