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. 架构-软件系统体系结构-B/S架构:B/S架构

    ylbtech-架构-软件系统体系结构-B/S架构:B/S架构 B/S架构即浏览器和服务器架构模式.它是随着Internet技术的兴起,对C/S架构的一种变化或者改进的架构.在这种架构下,用户工作界面 ...

  2. arttemplate02

    1.后台传来的数据 { "code": 200, "checkRecords": [ { "id": "402881e75cc80 ...

  3. Linux初始化的汇编代码

    1. 内核文件布局 首先看一下arch/x86/boot/Setup.ld文件,它定义了链接后的内核文件布局. 1: /* 2: * setup.ld 3: * 4: * Linker script ...

  4. pcre2 正则库

    \S+ 不能匹配到字符串末尾的最后一个字段

  5. linux每日命令(2):ps命令

    ps命令真是我比较常用的命令了,只是也没咋仔细研究过,最大的用处就是写代码的时候,起了多进程,就会占用多个进程,如果程序异常了,进程确没有kill掉,那么再启动程序就会报错 正常起项目 如果进程被占用 ...

  6. Flyway - Version control for your database

    Flyway 是什么? Flyway是个数据库版本管理工具.在开发过程中,数据库难免发生变更,例如数据变更,表结构变更.新建表或者视图等等. 在项目进行时无法保证一旦开发环境中的数据库内容变化候会去测 ...

  7. linux磁盘分区、挂载、查看

    实战: 34    查看本机所有磁盘                 fdisk -l 35    查看磁盘挂载情况                lsblk -f 36            39: ...

  8. selenium IDE的安装及录制回放的简单使用

    1.Selenium IDE下载地址为http://docs.seleniumhq.org/download/(需要翻墙) 2.直接单机“Download version”后面的版本号即可开始下载 3 ...

  9. 用C#简单实现的36进制转换代码

    private const string initValue = "A0000001"; private static string cs = "0123456789AB ...

  10. Centos 安装php Imagick 扩展

    从 centos 仓库安装 首先安装 php-pear php-devel,gcc三个软件包 yum install php-pear php-devel gcc 通过 yum 安装Centos 官方 ...