MariaDB版本10.1.21

Fedora版本25

1.Change root user

  sudo -i

2. dnf install -y mysql

dnf install -y mariadb-server

3. Start mariadb server and autostart mariadb on boot

  systemctl start mariadb.server #启动

   systemctl enable mariadb.service #随系统启动

4. 初始设置mariadb

 /usr/bin/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):
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] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success! 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! 5.Connect to mysql database(localhost) with password
mysql -u root -p
6.设置远程访问权限

  GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123' WITH GRANT OPTION; ##root用户可以使用密码123从任何地方访问

  FLUSH   PRIVILEGES; #刷新生效

  GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.3' IDENTIFIED BY '123' WITH GRANT OPTION;  ##root用户可以使用密码123从192.168.1.3访问

  FLUSH   PRIVILEGES;

  GRANT ALL PRIVILEGES ON  mydb.* TO 'root'@'192.168.1.3' IDENTIFIED BY '123' WITH GRANT OPTION; ##root用户可以使用密码123从192.168.1.3访问mydb数据库

  FLUSH   PRIVILEGES;

7.设置firewall防火墙

  7.1 取得激活的防火墙区域

    firewall-cmd --get-active-zones

例如输出:

    FedoraServer   #区域

      interfaces:ens33  #网卡

  7.2 添加防火墙规则

    firewall-cmd --permanent --zone=FedoraServer  --add-service=mysql

      或者

    firewall-cmd --permanent --zone=FedoraServer  --add-port=3306/tcp

    firewall-cmd --permanent --zone=FedoraServer  --add-port=6379/tcp

    firewall-cmd --permanent --zone=FedoraServer  --add-port=6380/tcp

    firewall-cmd --permanent --zone=FedoraServer  --add-port=6381/tcp

  7.3 重启防火墙

    systemctl restart firewalld.service

8.done

    

Fedora25安装mariadb并设置权限的更多相关文章

  1. centos7下安装mysql8.0.12及设置权限

    一.mysql版本介绍 mysql的官网为:https://www.mysql.com/ 在官网上可以看到多个版本,主要版本如下, 1.MySQL Community Server 社区版本,开源免费 ...

  2. CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置

    1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB,两条命令都可以 systemctl sta ...

  3. Linux下编译安装MariaDB

    MariaDB是MySQL的一个开源分支,主要是社区在维护,并且完全兼容MySQL,并且可以很方便的称为MySQL的替代,MariaDB的诞生正是出自MySQL创始人Michael Widenius之 ...

  4. Centos 使用YUM安装MariaDB

    1.在 /etc/yum.repos.d/ 下建立 MariaDB.repo,内容如下: [azureuser@mono etc]$ cd /etc/yum.repos.d [azureuser@mo ...

  5. 安装MariaDB和简单配置

    1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start maria ...

  6. Cenos7 编译安装 Mariadb Nginx PHP Memcache ZendOpcache (实测 笔记 Centos 7.0 + Mariadb 10.0.15 + Nginx 1.6.2 + PHP 5.5.19)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 安装步骤: 1.准备 1.1 显示系统版 ...

  7. Centos6.6下安装MariaDB步骤,利用yum进行安装 第二篇

    一.安装过程参考的相关文章: Centos 使用YUM安装MariaDB CentOS安装并设置MariaDB CentOS用yum安装.配置MariaDB MariaDB远程连接配置 ERROR 1 ...

  8. Linux下使用yum安装MariaDB

    版本:centos7 Linux下安装MariaDB官方文档参见:https://mariadb.com/kb/zh-cn/installing-mariadb-with-yum/ 1.创建Maria ...

  9. 在centos上编译安装mariadb数据库

    一.安装前提(准备数据文件.安装其他依赖的软件) 1.准备数据存放的目录 [root@localhost ~]# fdisk /dev/sdb  (fdisk /dev/sdb 创建一个逻辑分区/de ...

随机推荐

  1. 3.2 Redux TodoApp

    上一节讲完了 redux 中的概念,但是仍然没有和 react 联系起来,这一节将利用 redux 在 react 中实现完整的 todolist: 在 react 使用 redux 通过 Provi ...

  2. flex上下、左右居中

    tip:1)flex是用于div布局用的,作用于一级子元素(父元素写样式,作用于子元素) 2)弹性盒模型 3)英文解释justify-content: 对齐内容(内容一般写在主轴上)align-ite ...

  3. 剑指offer——61平衡二叉树

    题目描述 输入一棵二叉树,判断该二叉树是否是平衡二叉树.   题解: 方法一:使用深度遍历,判断每个节点是不是平衡二叉树,这种从上至下的方法会导致底层的节点重复判断多次 方法二:使用后序遍历判断,这种 ...

  4. opencv 打开摄像头(c++)

    1,打开视频文件 2,打开IP摄像头 读取大华摄像头 大华的网络摄像头编号:DH-IPC-HFW1225M-I1-0600B,用的是RTSP协议. "rtsp://admin:dahua@1 ...

  5. 淘宝内核月报2014-11-draft

    内核月报2014-11-draft MySQL· 捉虫动态·OPTIMIZE 不存在的表 bug 描述 这是一个和 GTID 相关的Bug,也就是说5.6才会有,并且出现这个 bug 需要满足条件: ...

  6. 关于windows cmd的一些便捷应用

    在同事的指点下,我学会了一种非常方便的进入路径的方法 在windows文件夹中直接打开到要执行的文件的位置,然后在我的电脑那个路径当中输入cmd 之后,cmd的对话框会弹出来,并且显示在当前路径下,这 ...

  7. 使用ribbon实现负载均衡

    使用ribbon之前的准备工作: 1.你要有两个服务,一个是服务消费方(下图的xing-movie是消费方),一个是服务提供方(xing-user是服务提供者),并且服务提供方要有两个实例,也就是xi ...

  8. Box-Cox变换

    简介 编辑 Box-Cox变换的一般形式为: 式中    为经Box-Cox变换后得到的新变量,    为原始连续因变量,    为变换参数.以上变换要求原始变量    取值为正,若取值为负时,可先对 ...

  9. svn 一、 安装及汉化

    svn 是日常开发过程中常用的版本控制工具 第一步 安装 进入官网 https://tortoisesvn.net/ 点击downloads 进入之后选中 需要的版本,及位数 这里推荐安装最新版的 因 ...

  10. 使用 Google Chrome 数据抓包方式免费下载收费音乐

    对于每个有音乐细胞的 boys & girls 来说,听音乐的时候是不是会经常遇到如下图的问题. 自从音乐进入正版之后,很多歌曲只有付费用户才可以下载.虽然可以在线听,可是以我的倔脾气,就是喜 ...