MariaDB管理系统

[root@c4kaichen@163 ~]# yum install mariadb
[root@c4kaichen@163 ~]# yum install -y mariadb-server.x86_64

开启:
[root@c4kaichen@163 ~]# systemctl start mariadb --有报错的话删除 /var/lib/mysql 和 /etc/my.cnf 重新安装就没有错了

设置开机自动启动该服务:
[root@localhost ~]# systemctl enable mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

初始化设置:
[root@c4kaichen@163 ~]# mysql_secure_installation

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):
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:
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] n
... skipping.

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@c4kaichen@163 ~]# firewall-cmd --permanent --add-service=mysql
success
[root@c4kaichen@163 ~]# firewall-cmd --reload
success

登录数据库:
[root@c4kaichen@163 ~]# mysql -u root -p
Enter password:

查看已有数据库:

MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.00 sec)

备份数据:
mysqldump -u root -p cisco >/tmp/package2/ciscobackup.dump

恢复数据:

[root@c4kaichen@163 ~]# mysql -u root -p cisco </tmp/package2/ciscobackup.dump

解决远程主机不能连接的问题:
[root@localhost ~]# mysql -u root -p
MariaDB [mysql]> select * from user;
insert into user (host,user,password) values ('172.30.2.13','root','*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B')
> flush privileges;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT O
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '1*81F5E21E35407D884A6CD4A731AEBFB6AF209E1B' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'172.30.2.13 BY 'root' WITH GRANT OPTION;

GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.100.%' IDENTIFIED BY 'my-new-password' WITH GRANT OPTION;

---------------------------------------------------------------------------------------------------------

报错处理:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

MariaDB管理系统的更多相关文章

  1. 第18章 使用MariaDB数据库管理系统

    章节概述: MYSQL数据库管理系统被Oracle公司收购后从开源换向到了封闭,导致包括红帽在内的许多Linux发行版选择了MariaDB. 本章节将教会您使用mariaDB数据库管理工具来管理数据库 ...

  2. MariaDb数据库管理系统的学习(一)安装示意图

    MariaDB数据库管理系统是MySQL的一个分支.主要由开源社区在维护,採用GPL授权许可.开发这个分支的原因之中的一个是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险,因此社区採用分 ...

  3. 关于数据库管理系统DBMS--关系型数据库(MySQL/MariaDB)

    数据库的结构(3种):层次,网状,关系型(用的最多): DBMS的三层模型: 视图层:面向最终用户: 逻辑层:面向程序员或DBA: 物理层:面向系统管理员: 关系型数据库管理系统——RDBMS: 主要 ...

  4. MariaDB数据库管理系统

    MYSQL数据库管理系统被Oracle公司收购后从开源换向到了封闭,导致许多Linux发行版选择了MariaDB.   MYSQL是一款大家都非常熟知的数据库管理系统,技术成熟.配置简单.开源免费并且 ...

  5. Linux基础学习-MariaDB数据库管理系统

    数据库管理系统 数据库是指按照某些特定结构来存储数据资料的数据仓库,数据库管理系统是一种能够对数据库中存放的数据进行建立.修改.删除.查找.维护等操作的软件程序. 初始化MariaDB服务 [root ...

  6. 《Linux就该这么学》培训笔记_ch18_使用MariaDB数据库管理系统

    <Linux就该这么学>培训笔记_ch18_使用MariaDB数据库管理系统 文章最后会post上书本的笔记照片. 文章主要内容: 初始化MariaDB服务 管理用户以及授权 创建数据库与 ...

  7. MariaDb数据库管理系统学习(二)使用HeidiSQL数据库图形化界面管理工具

    HeidiSQL 是一款用于简单化的 MySQL server和数据库管理的图形化界面.该软件同意你浏览你的数据库,管理表,浏览和编辑记录,管理用户权限等等.此外,你能够从文本文件导入数据,执行 SQ ...

  8. mariadb

    MariaDB数据库管理系统是MySQL的一个分支

  9. 15 个有用的 MySQL/MariaDB 性能调整和优化技巧(转载的一篇好文)

    MySQL 是一个强大的开源关系数据库管理系统(简称 RDBMS).它发布于 1995 年(20年前).它采用结构化查询语言(SQL),这可能是数据库内容管理中最流行的选择.最新的 MySQL 版本是 ...

随机推荐

  1. MyEclipse WebSphere开发教程:安装和更新WebSphere 6.1, JAX-WS, EJB 3.0(五)

    MyEclipse超值折扣 限量 100 套! 立即开抢>> [MyEclipse最新版下载] MyEclipse支持Java EE技术(如JAX-WS和EJB 3.0),它们以功能包的形 ...

  2. OC基础:内存(内存管理) 分类: ios学习 OC 2015-06-25 16:50 73人阅读 评论(0) 收藏

    自动释放池: @autoreleasepool { } 内存管理机制       谁污染,谁治理 垃圾回收机制:gc(Garbage collection),由系统管理内存,开发人员不需要管理. OC ...

  3. 微信小程序插件使用

    使用插件 小程序开发者可便捷地把插件添加到自己的小程序内,丰富小程序的服务.当用户在使用小程序时,将可以在小程序内使用插件提供的服务. 开放范围 所有小程序 接入流程 在小程序管理后台添加插件 小程序 ...

  4. Unity3D游戏-愤怒的小鸟游戏源码和教程(一)

    Unity愤怒的小鸟游戏教程 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) AngryEva游戏效果: 1 ...

  5. UVA 10305:Ordering Tasks(拓扑排序)

    #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm& ...

  6. 牛客小白月赛2 E:是是非非(尼姆博弈)

    链接:https://www.nowcoder.com/acm/contest/86/E来源:牛客网 题目描述 坎为水,险阳失道,渊深不测:离为火,依附团结,光明绚丽.坎卦:水洊至,习坎:君子以常德行 ...

  7. CTF-练习平台-Misc之 Convert

    十八.Convert 打开后发现是01代码,转换为16进制代码如下 将代码复制到winhex里面发现是rar文件,保存 打开后发现里面有个图片 解压后在图片的属性里发现一段base64代码,对其解密 ...

  8. 《DSP using MATLAB》 Problem 3.19

    先求模拟信号经过采样后,对应的数字角频率: 明显看出,第3种采样出现假频了.DTFT是以2π为周期的,所以假频出现在10π-2kπ=0处. 代码: %% ----------------------- ...

  9. sqlserver linux 容器运行

    sqlserver linux 版本的容器大小目前已经相对比较小了,对于开发来说已经比较方便了 docker-compose 文件 version: "3" services: d ...

  10. JMeter连接数据库(查询出的数据作为参数)

    针对Mysql jdbc:mysql://ip:3306/数据库名?useUnicode=true&characterEncoding=utf8&allowMultiQueries=t ...