1、背景

Maria Db是流行的跨平台MySQL数据库管理系统的分支,被认为是MySQL 的完全替代品。Maria Db是由Sun在Sun Micro systems合并期间被Oracle收购后,于2009年由MySQL的一位原始开发人员创建的。今天,Maria Db由Maria Db Foundation和社区贡献者维护和开发,

Maria Db将MySQL替换为Cent OS 7存储库中的默认数据库系统。虽然将MySQL安装到Cent OS 7并不困难,但是如果您只需要一个数据库,建议使用Maria Db进行官方支持,并且与其他存储库软件不兼容的可能性很小。

2、开始之前

虚拟机是最好的伙伴,推荐安装一个VM+CentOS 自己动手试试

$ 表示系统的一般权限,不用使用root 超级管理员权限配置。

要检查您的主机名:

$ hostname -f

$ hostname

1.1 安装开始

第一个命令应显示您的短主机名,第二个命令应显示您的完全限定域名(FQDN)。

更新您的系统:

$ sudo yum update

安装并启动MariaDB

$ sudo yum install mariadb-server

启用MariaDB以在启动时启动,然后启动该服务:

systemctl start mariadb

systemctl status mariadb

systemctl enable mariadb

默认情况下,MariaDB将绑定到localhost(127.0.0.1)。

注意

允许在公共IP上不受限制地访问MariaDB,但是您可以在/etc/my.cnf中通过修改bind-address参数来更改它侦听的地址。如果您决定将MariaDB绑定到公共IP,则应实施仅允许来自特定IP地址连接的防火墙规则。

[root@centos001 ~]# systemctl start mariadb

[root@centos001 ~]# systemctl status mariadb

● mariadb.service - MariaDB database server

Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)

Active: active (running) since Wed 2019-05-08 15:23:10 CST; 14s ago

Process: 13148 ExecStartPost=/usr/libexec/mariadb-wait-ready $MAINPID (code=exited, status=0/SUCCESS)

Process: 13069 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir %n (code=exited, status=0/SUCCESS)

Main PID: 13147 (mysqld_safe)

CGroup: /system.slice/mariadb.service

├─13147 /bin/sh /usr/bin/mysqld_safe --basedir=/usr

└─13309 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mariadb/mariadb.log --pid-file=/var/run/mariadb/mariadb...

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: MySQL manual for more instructions.

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: Please report any problems at http://mariadb.org/jira

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: The latest information about MariaDB is available at http://mariadb.org/.

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: You can find additional information about the MySQL part at:

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: http://dev.mysql.com

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: Consider joining MariaDB's strong and vibrant community:

May 08 15:23:08 centos001 mariadb-prepare-db-dir[13069]: https://mariadb.org/get-involved/

May 08 15:23:08 centos001 mysqld_safe[13147]: 190508 15:23:08 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.

May 08 15:23:08 centos001 mysqld_safe[13147]: 190508 15:23:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

May 08 15:23:10 centos001 systemd[1]: Started MariaDB database server.

[root@centos001 ~]#

1.2 最后检测

安装完成之后,运行一下命令,进入数据库,默认不需要密码

$ mysql -uroot -p

- 查询数据库列表

[root@centos001 ~]# mysql -u root -p

Enter password:

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MariaDB connection id is 13

Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation 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 |

| test |

+--------------------+

4 rows in set (0.00 sec)

MariaDB [(none)]>

安装到此结束,余下是介绍如何使用配置

3、初始化配置,MariaDB的相关简单配置

接下来进行

$ mysql_secure_installation

首先是设置密码,会提示先输入密码

Enter current password for root (enter for none):

设置密码

Set root password? [Y/n]

New password:

Re-enter new password:

其他配置

Remove anonymous users? [Y/n]

Disallow root login remotely? [Y/n]

Remove test database and access to it? [Y/n]

Reload privilege tables now? [Y/n]

我的设置,设置错了再来一次

初始化MariaDB完成,接下来测试登录,输入一下命令和密码 登录进去

$ mysql -u root -p

4、操作不会请输入Help

要为MariaDB提示生成命令列表,请输入\h。然后你会看到:

List of all MySQL commands:

Note that all text commands must be first on line and end with ';'

? (\?) Synonym for `help'.

clear (\c) Clear the current input statement.

connect (\r) Reconnect to the server. Optional arguments are db and host.

delimiter (\d) Set statement delimiter.

edit (\e) Edit command with $EDITOR.

ego (\G) Send command to mysql server, display result vertically.

exit (\q) Exit mysql. Same as quit.

go (\g) Send command to mysql server.

help (\h) Display this help.

nopager (\n) Disable pager, print to stdout.

notee (\t) Don't write into outfile.

pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.

print (\p) Print current command.

prompt (\R) Change your mysql prompt.

quit (\q) Quit mysql.

rehash (\#) Rebuild completion hash.

source (\.) Execute an SQL script file. Takes a file name as an argument.

status (\s) Get status information from the server.

system (\!) Execute a system shell command.

tee (\T) Set outfile [to_outfile]. Append everything into given outfile.

use (\u) Use another database. Takes database name as argument.

charset (\C) Switch to another charset. Might be needed for processing            binlog with multi-byte charsets.

warnings (\W) Show warnings after every statement.

nowarning (\w) Don't show warnings after every statement.

For server side help, type 'help contents'

MariaDB [(none)]>

5 重置MariaDB Root密码

** 如果您忘记了root 密码,则可以重置密码。**

停止当前的MariaDB服务器实例,然后使用不要求输入密码的选项重新启动它:

sudo systemctl stop mariadb

sudo mysqld_safe --skip-grant-tables &

使用MariaDB root帐户重新连接到MariaDB服务器:

mysql -u root

使用以下命令重置root的密码。用强密码替换password:

use mysql;

update user SET PASSWORD=PASSWORD("password") WHERE USER='root';

flush privileges;

exit

然后重启MariaDB:

sudo systemctl start mariadb

centos7 mariadb mysql_【软件安装】CentOS7安装MariaDb(mysql_替代品安装)相关推荐

  1. Centos7 编译安装 Nginx、MariaDB、PHP

    前言 本文主要大致介绍CentOS 7下编译安装Nginx.MariaDB.PHP.面向有Linux基础且爱好钻研的朋友.技艺不精,疏漏再所难免,还望指正. 环境简介: 系统: CentOS 7,最小 ...

  2. Centos7.4系统下安装httpd,mariadb,php7.1环境运行禅道

    Centos7.4系统下安装httpd,mariadb,php7.1环境运行禅道 简介:本文介绍如何在Centos7.4系统下面使用yum命令安装httpd,php7.1与mariadb服务,并使用禅 ...

  3. 阿里云centos7配置php mysql_阿里云centos7安装NGINX+MYSQL+PHP-FPM环境

    前言 LIUNX服务器部署,百度找的资料有些都是老的.查了一些资料顺便整合了一下,阿里云服务器(ECS)可以选择多种操作系统,打算用它运行Drupal或者WordPress,你最好选择Liunx系统, ...

  4. CentOS7下的软件安装方法及策略详解

    CentOS7下的软件安装方法及策略详解 互联网   01-24 15:15:09   作者:佚名   我要评论 今天小编为大家带来的是CentOS7下的软件安装方法及策略详解:希望对大家安装Cent ...

  5. 阿里云centos 7.6安装mysql_阿里云Centos7上安装MySQL教程

    1 基本安装过程 1.查看系统是否安装了mysql软件 # rpm -qa|grep -i mysql 2.将已经安装过的软件卸载掉.注意:这样的卸载是不彻底,不过这里够用了 # yum remove ...

  6. 安装linux32库,Centos7安装32位库用来安装32位软件程序

    解决不安装VC运行库(VC2005,VC2008),程序运行出错的方法 因为VS2005以后程序采用了manifest的生成方式,所以发布的时候要和运行库一起发布.但是我们平时开发和发布的时候如果都要 ...

  7. 用yum源配合源码包安装openresty、mariadb、php7服务

    在开始部署之前,有必要先简单介绍一下! OpenResty 是一个基于 Nginx 与 Lua 的高性能 Web 平台,其内部集成了大量精良的 Lua 库.第三方模块以及大多数的依赖项.用于方便地搭建 ...

  8. Docker在Centos7安装、及命令(详细安装教程)

    Docker在Centos7安装.及命令(详细安装教程) 为什么使用Docker Docker中包括三个基本概念 Docker安装 Docker获取镜像 使用刚刚获取的centos镜像,创建一个容器, ...

  9. 九阴真经Ambari——3.安装并配置MariaDB

    转载请注明出处:https://yuhaidong.blog.csdn.net//article/details/86693553 本文出自[我是干勾鱼的博客] Ingredients: Java:J ...

最新文章

  1. Python使用matplotlib可视化箱图、seaborn中的boxplot函数可视化分组箱图、在箱图中添加抖动数据点(Dot + Box Plot)
  2. 如何更改gridview中任意单元格颜色或者内容。
  3. 如何在多线程中调用winform窗体控件2——实例篇
  4. c++之数组指针作为形参,并返回数组
  5. G6 图可视化引擎——核心概念——节点/边/Combo——内置节点——内置节点总览
  6. 计算机网络实验做什么的,计算机网络实验,做网线.ppt
  7. python表达式352的值为_表达式 3 and 5 的值为
  8. 苏宁易购:全国1071万高考生可免费领取SUPER会员
  9. 海运业务常用缩略语 一
  10. IIS 7.5配置PHP更容易!
  11. Visual C++ 图像处理类库CxImage源代码
  12. 百面机器学习—13.L1正则化与稀疏性
  13. 十大最受欢迎蓝牙耳机品牌推荐,学生党打工人平价蓝牙耳机
  14. 连接 GIS Servers报错“Proxy server got bad address from remote server ...”
  15. 最完美的matlab绘图教程集合
  16. python report_python之reportlab
  17. ipad wifi信号测试软件,iPad3的wifi信号弱 二种方法修复WiFi信号
  18. 计算机组成原理第五版第四章课后答案,计算机组成原理第四章课后习题及答案_唐朔飞(完整版).docx...
  19. laravel文件命名规范
  20. Python练习题 01

热门文章

  1. javaScript = == ===的区别
  2. 关于html5之canvas的那些事
  3. 将Sphinx的日志放置到/dev/shm里需要注意的事情
  4. 设置窗体的可见性无效
  5. 非金钱激励员工的108种手段【转-摘】
  6. sql 中 case when 语法
  7. [转载] Python语言程序设计基础(第二版)嵩天等课后习题答案
  8. [转载] Python数据分析:python与numpy效率对比
  9. BZOJ 4033: [HAOI2015]树上染色
  10. (转载)Android项目实战(二十七):数据交互(信息编辑)填写总结