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持续性开发教程:用JPA和Spring管理数据(三)

    MyEclipse红运年货节 在线购买低至69折!火爆开抢>> [MyEclipse最新版下载] 本教程介绍了MyEclipse中的一些基于JPA / Spring的功能.有关设置JPA项 ...

  2. WebGL编程指南理论分析之物体层次模型(局部运动)

    书中340页,开始讲到层次模型(关节模型),也就是整个物体,可以自由控制其各部位单独运动,就像关节一样,互不干扰或者有一定关联. 就像图中,左右键控制整个物体(arm1和arm2)的Y轴旋转,上下键控 ...

  3. Object -c基础知识(5)--release 之后 retainCount为何为1

    在XCode中加入如下代码:  UILabel *label=[UILabel alloc]; [label setText:@"TestLabel"]; NSLog(@" ...

  4. exit和return

    函数名: exit() 所在头文件:stdlib.h(如果是”VC6.0“的话头文件为:windows.h) 功 能: 关闭所有文件,终止正在执行的进程. exit(1)表示异常退出.这个1是返回给操 ...

  5. 利用git向github中推送文件

    /*游戏或者运动才能让我短暂的忘记心痛,现如今感觉学习比游戏和运动还重要——曾少锋*/ 如果对git不够熟悉的学者,可以参考:http://www.cnblogs.com/zengsf/p/75062 ...

  6. MyEclipse快捷键及经验总结 绝对的有用 太给力了

    Ctrl+Shift+L    显示所有快捷键  Ctrl+K      参照选中的词(Word)快速定位到下一个  Ctrl+Shift+K    参照选中的词(Word)快速定位到上一个    C ...

  7. ajax请求成功回调函数没有执行问题

    如下常见的ajax前端请求,请求成功后success:function(result){ 这里的数据没有执行 }: $.ajax({ type:"post", url:" ...

  8. 强连通分量【k 算法、t 算法】

    连通分量就是一个各个顶点能互相达到的图 无向图的连通分量选取任意一个顶点使用DFS遍历即可,遍历完所有顶点所需的DFS的次数就是连通分量的数量 有向图的强连通分量由于是有向的[从A点开始DFS能访问到 ...

  9. 【java编程】重写HashCode和equals方法

    [一]重写equals方案的规则 equals方法本来的原则 1.类的每个实例本质上都是唯一的. 2.不关心类是否提供了“逻辑相等”的测试功能 3.超类已经覆盖了equals,从超类继承过来的行为对于 ...

  10. 【转】python3中bytes和string之间的互相转换

    问题: 比对算法测试脚本在python2.7上跑的没问题,在python3上报错,将base64转码之后的串打印出来发现,2.7版本和3是不一样的:2.7就是字符串类型的,但是3是bytes类型的,形 ...