CentOS7系统安装 Maria Db(MYSQL)教程
一、背景
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进行官方支持,并且与其他存储库软件不兼容的可能性很小。
二、开始之前
$ 表示系统的一般权限,不用使用root 超级管理员权限配置。
要检查您的主机名:
$ hostname -f
$ hostname

第一个命令应显示您的短主机名,第二个命令应显示您的完全限定域名(FQDN)。
更新您的系统:
$ sudo yum update
安装并启动MariaDB
$ sudo yum install mariadb-server
启用MariaDB以在启动时启动,然后启动该服务:
$ sudo systemctl enable mariadb
$ sudo systemctl start mariadb
默认情况下,MariaDB将绑定到localhost(127.0.0.1)。
注意
允许在公共IP上不受限制地访问MariaDB,但是您可以在
/etc/my.cnf中通过修改bind-address参数来更改它侦听的地址。如果您决定将MariaDB绑定到公共IP,则应实施仅允许来自特定IP地址连接的防火墙规则。
安装完成之后,运行一下命令,进入数据库,默认不需要密码
$ mysql -uroot -p

查询数据库列表
$ show databses;

安装到此结束,余下是介绍如何使用配置
三、初始化配置,MariaDB的相关简单配置
接下来进行
$ mysql_secure_installation
首先是设置密码,会提示先输入密码
Enter current password for root (enter for none):<–初次运行直接回车
设置密码
Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码
其他配置
Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车,
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车

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

四、操作不会请输入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)]>
五、重置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系统安装 Maria Db(MYSQL)教程的更多相关文章
- 【转】CentOS7 64位安装mysql教程
从最新版本的linux系统开始,默认的是 Mariadb而不是mysql!这里依旧以mysql为例进行展示 1.先检查系统是否装有mysql rpm -qa | grep mysql 这里返回空值,说 ...
- CentOS7 64位安装mysql教程
参考链接:http://baijiahao.baidu.com/s?id=1597184796823517712&wfr=spider&for=pc https://www.cnblo ...
- Centos7中用Docker安装MySQL教程
第一步 安装Docker 1.1 参考这位博主给出的命令安装好 https://blog.csdn.net/weixin_43423864/article/details/109481260 第二步 ...
- 数据库发出sql命令mysql教程
$db = mysql教程_connect("localhost", "phpdb", "phpdb");mysql_select_db(& ...
- Linux中数据库的安装和配置(MySQL与Maria DB)
目录 MySQL和Maria DB的介绍 MySQL和Maria DB的安装 yum源安装MySQL(Centos6.5+Mysql5.1) 源码包安装MySQL yum源安装Maria DB 源码包 ...
- 为什么要 MySQL 迁移到 Maria DB
在Oracle收购了SUN公司之后, MySQL很不幸的落在了Oracle的手中,MySQL与Oracle DB存在竞争关系,很可能导致Oracle公司影响MySQL的开发与开放.MySQL之父Wid ...
- Deepin系统安装mysql教程及相关操作
Deepin系统安装mysql教程及相关操作 1.安装MySQL sudo apt-get install mysql-server,期间需要输入两次密码,root账户的密码. sudo apt-ge ...
- CentOS7.5 安装MySql教程
CentOS7位安装MySql教程 1.先检查系统是否装有mysql rpm -qa | grep mysql 2.下载mysql的repo源 wget http://repo.mysql.com/m ...
- 阿里云Centos7上安装MySQL教程
1 基本安装过程 1.查看系统是否安装了mysql软件 # rpm -qa|grep -i mysql 2.将已经安装过的软件卸载掉.注意:这样的卸载是不彻底,不过这里够用了 # yum remove ...
随机推荐
- VMware Workstation 虚拟机的服务启动项
- write()和print()还有<%= %>的细微区别
1.首先介绍write()和print()方法的区别: (1).write():仅支持输出字符类型数据,字符.字符数组.字符串等 (2).print():可以将各种类型(包括Object)的数据通过默 ...
- Solr Dismax查询解析器-深入分析
Solr 支持多种查询解析,给搜索引擎开发人员提供灵活的查询解析.Solr 中主要包含这几个查询解析器:标准查询解析器.DisMax 查询解析器,扩展 DisMax 查询解析器(eDisMax) Di ...
- POJ1163 数学三角求最大路径
描述:输入,行数,之后接数据,第一行一个数据,之后每行加一.5 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 思路:简单动态规划问题.dp[i][j]定义为到这个数为止(包括这个数)的最 ...
- wcf 调试
1>在开发环境中调试,我们先在WCF服务上将服务Serivce1.svc设置为启动页面 然后在WCF上Debug中启动新实例 服务就启动起来了 2>wcf发布以后调试,只需在Visual ...
- macOS 10.13 安装Virtualbox失败
macOS 10.13 安装Virtualbox失败 Enviroment macOS: 10.13 High Sierra virtualBox: 5.1.28 Problem descriptio ...
- Zookeeper 源码(六)Leader-Follower-Observer
Zookeeper 源码(六)Leader-Follower-Observer 上一节介绍了 Leader 选举的全过程,本节讲解一下 Leader-Follower-Observer 服务器的三种角 ...
- 一)get started with the Quartz project
官网 http://www.quartz-scheduler.org/ 下载链接 http://www.terracotta.org/download/reflector.jsp?b=tcdistri ...
- UILabel 字体下方加下划线
UILabel *knowKankan = [[UILabel alloc] initWithFrame:CGRectMake(0, MAINHEIGHT - 78 , MAINWIDTH, ...
- Cacti部署
1>监控概述 通常运维人员在一个企业当中所需要管理一台或者多台服务器,或者甚至更多,特别是BAT公司或者门户级别的公司,一个人管理的服务器可能上百甚至上千台 ...