MySQL/MariaDB随笔一
1.yum 安装后先跑一下系统自带的安全脚本,否则数据库很不安全,任何人都可以登录
[root@xixi ~]# 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.
#输入root的密码,如果没有root密码直接回车就可以
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.
#设置root的密码
Set root password? [Y/n]y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
#到此处数据库的root账号密码设置完成。
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
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
#是否禁用root账号远程登陆
Disallow root login remotely? [Y/n]n
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
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
#重新加载特权表(是否使以上配置生效)
Reload privilege tables now? [Y/n]y
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
#数据库的安全配置完成
2.[root@xixi ~]# mysql -uroot -p #mysql -uroot -p123456 也可以登录 但是不安全
Enter password:
用此样式登录数据库,不要-p直接加密码,不安全
3.MariaDB [(none)]> select user();#查看登录的用户
4.默认端口3306
MySQL/MariaDB随笔一的更多相关文章
- MySQL/MariaDB随笔二
mariaDB的二进制安装:系统版本和MariaDB版本 [root@ ~]# cat /etc/redhat-release CentOS Linux release (Core) [root@ ~ ...
- MySQL/MariaDB/PerconaDB-提权条件竞争漏洞
背景 2016年11月01日,国外安全研究员Dawid Golunski在 MySQl, MariaDB 和 PerconaDB 数据库中发现条件竞争漏洞,该漏洞允许本地用户使用低权限(CREATE/ ...
- 15 个有用的 MySQL/MariaDB 性能调整和优化技巧(转载的一篇好文)
MySQL 是一个强大的开源关系数据库管理系统(简称 RDBMS).它发布于 1995 年(20年前).它采用结构化查询语言(SQL),这可能是数据库内容管理中最流行的选择.最新的 MySQL 版本是 ...
- 【原】基于 HAproxy 1.6.3 Keeplived 在 Centos 7 中实现mysql mariadb galera cluster 集群分发读写 —— 上篇
前言 有一段时间没有写blogs,乘着周末开始整理下haproxy + keeplived 实现 mysql mariadb galera cluster 集群访问环境的搭建工作. 本文集中讲hapr ...
- 在CentOS 7 MySQL / MariaDB
在CentOS7中,MariaDB 替代了MySQL;更多复杂的疑问可以在这里查看 MariaDB versus MySQL – Compatibility Install MySQL / Mari ...
- MySQL/MariaDB/Percona数据库升级脚本
MySQL/MariaDB/Percona数据库升级脚本截取<OneinStack>中upgrade_db.sh, 一般情况下不建议升级数据库版本,该脚本专提供给各位版本控们.为防止大版本 ...
- MySQL/MariaDB中游标的使用
本文目录:1.游标说明2.使用游标3.游标使用示例 1.游标说明 游标,有些地方也称为光标.它的作用是在一个结果集中逐条逐条地获取记录行并操作它们. 例如: 其中select是游标所操作的结果集,游标 ...
- 流程控制语句(MySQL/MariaDB )
本文目录:1.BEGIN...END2.true和false3.if结构4.case结构5.loop.leave和iterate6.repeat循环7.while循环 MySQL/MariaDB中的符 ...
- MySQL/MariaDB触发器
本文目录:1.创建触发器2.insert触发器3.delete触发器4.update触发器5.通过on duplicate key update分析触发器触发原理6.replace to算法验证7.查 ...
随机推荐
- 百度Openrasp开源的应用运行时自我保护产品,安装教程。
第一步: 下载最新版本的安装包 https://packages.baidu.com/app/openrasp/release/latest/rasp-php-linux.tar.bz2 解压到目录: ...
- 数据库SQL语言从入门到精通--Part 3--SQL语言基础知识
数据库从入门到精通合集(超详细,学习数据库必看) 一.关系 单一的数据结构----关系 现实世界的实体以及实体间的各种联系均用关系来表示 逻辑结构----二维表 从用户角度,关系模型中数据的逻辑结构是 ...
- 04 全局局部配置 wxml数据绑定 事件 冒泡
一. 配置介绍 一个小程序应用程序会包括最基本的两种配置文件.一种是全局的 app.json 和 页面自己的 page.json(index.json /test.json等) 注意:配置文件中不能出 ...
- 最短路径树:Dijstra算法
一.背景 全文根据<算法-第四版>,Dijkstra算法.我们把问题抽象为2步:1.数据结构抽象 2.实现 二.算法分析 2.1 数据结构 顶点+边->图.注意:Dijkstra ...
- Java——抽象类与接口的前世今生
该系列博文会告诉你如何从入门到进阶,一步步地学习Java基础知识,并上手进行实战,接着了解每个Java知识点背后的实现原理,更完整地了解整个Java技术体系,形成自己的知识框架. 1.抽象类: 当编写 ...
- [译]ANDROID 11: BETA 计划
当我们开始计划 Android 11 的时候,我们没有预料到这些变化会发生在我们所有人身上,几乎遍及世界上的每一个地区. 这些挑战要求我们保持灵活性,寻找新的合作方式,特别是与我们的开发者社区合作. ...
- P3467(矩形覆盖问题)
描述:https://www.luogu.com.cn/problem/P3467 1.考虑如果整个建筑物链是等高的,一张高为链高,宽为整个建筑物宽的海报即可完全覆盖: 2.若有两个不等高的元素组成建 ...
- 【Hadoop离线基础总结】Hadoop的架构模型
Hadoop的架构模型 1.x的版本架构模型介绍 架构图 HDFS分布式文件存储系统(典型的主从架构) NameNode:集群当中的主节点,主要用于维护集群当中的元数据信息,以及接受用户的请求,处理用 ...
- [hdu4710 Balls Rearrangement]分段统计
题意:求∑|i%a-i%b|,0≤i<n 思路:复杂度分析比较重要,不细想还真不知道这样一段段跳还真的挺快的=.= 令p=lcm(a,b),那么p就是|i%a-i%b|的循环节.考虑计算n的答案 ...
- SpringBoot基础实战系列(三)springboot单文件与多文件上传
springboot单文件上传 对于springboot文件上传需要了解一个类MultipartFile ,该类用于文件上传.我此次使用thymeleaf模板引擎,该模板引擎文件后缀 .html. 1 ...