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. 计算1到N中包含数字1的个数

    转自:http://pandonix.iteye.com/blog/204840 Mark N为正整数,计算从1到N的所有整数中包含数字1的个数.比如,N=10,从1,2...10,包含有2个数字1. ...

  2. BOM 3.1 location对象 | history对象 | navigator对象 | 定时器 | 三大系列

    JavaScript分三个部分: 1. ECMAScript标准---基本语法 2. DOM--->Document Object Model 文档对象模型,操作页面元素的 3. BOM---& ...

  3. 在linux 下查询某个进程被那个程序占用

    ps -ef|grep pid ps -aux | grep pid 清除linux 缓存: echo 1 > /proc/sys/vm/drop_caches

  4. Pandas之read_excel()和to_excel()函数解析

    read_excel() 加载函数为read_excel(),其具体参数如下. read_excel(io, sheetname=0, header=0, skiprows=None, skip_fo ...

  5. .Net平台调用の初识

    前言 工作过程中难免遇到混合编程,现在我们要谈的是C#和c++语言的编程.C#要调用C++的库目前可选主要有两种方式:Com技术和平台调用(P/Invoke).现在我们要谈的是P/Invoke技术. ...

  6. 使用tensorboard报错 ImportError: No module named past.builtins

    安装 future pip install future conda install future

  7. springBoot优雅返回图片/网页到浏览器

    一.普通spring mvc返回图片或网页到浏览器 @Controller @RequestMapping(value = "/image") public class Image ...

  8. Linux grep return code

    The exit code is 1 because nothing was matched by grep. EXIT STATUS The exit status is 0 if selected ...

  9. Mysql ibd恢复

    一,binlog恢复,这里就不说了. 二,ibd方式其实很简单, 生成数据结构(有的可以跳过) 1,创建一个新库 2,新库里新建一个表,名字和回复的表一样. 字段数量一样(字段类型和名字都无所谓) 3 ...

  10. [LOJ#6468.] 魔法

    官方题解 看了题解才会做.. 首先考虑如果所有询问的点都是[1,n]的做法,如果询问是[l,r]只需要把多余的去掉就好了 然后要把问题转化为一个点对其他附近的点的贡献 记$pre[i]$为第i个位置的 ...