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. 您应升级到 MySQL 5.5.0 或更高版本。 phpmyadmin

    最近又折腾LAMP了.从官方下载的phpmyadmin在部署的时候发现 “您应升级到 MySQL 5.5.0 或更高版本”.原因是我安装的mysql数据库版本过低. 解决思路: 1.升级mysql版本 ...

  2. Dubbo入门到精通学习笔记(八):ActiveMQ的安装与使用(单节点)、Redis的安装与使用(单节点)、FastDFS分布式文件系统的安装与使用(单节点)

    文章目录 ActiveMQ的安装与使用(单节点) 安装(单节点) 使用 目录结构 edu-common-parent edu-demo-mqproducer edu-demo-mqconsumer 测 ...

  3. linux 创建多级目录 mkdir -p

    原文地址:http://www.dutor.net/index.php/2010/06/cmd-mkdir-p/ mkdir的-p选项允许你一次性创建多层次的目录,而不是一次只创建单独的目录.例如,我 ...

  4. hbase之setCaching 和 setBatch 和setMaxResultSize

    scan的setBatch()用法 val conf = HBaseConfiguration.create() val table: Table = ConnectionFactory.create ...

  5. CUDA编程之环境配置

    VS2015+CUDA8.0环境配置 Anyway,在这里记录下正确的配置方式: 1.首先,上官网下载对应vs版本的CUDA toolkit: https://developer.nvidia.com ...

  6. html select美化模拟jquery插件select2.js

    代码展示:http://www.51xuediannao.com/demo.php 代码说明: select2.js是一个html select美化模拟类jquery插件,但是select2.js又远 ...

  7. ArcGis基础——动态显示面要素的面积值

    很基础,不赘述. 1.在catalog(目录)新建一个PersonalGeoDatabase(个人地理数据库),导入需要处理的Shapefile文件. 坐标系统,存储路径与命名根据自己需求设定 2.直 ...

  8. 搭建WordPress博客程序库

    搭建WordPress博客程序库 wordpress简介 wordpress是一套利用PHP语言和Mysql数据库开发的开源免费的Blog(博客,网站)程序,用户可以在支持PHP环境和Mysql数据库 ...

  9. hadoop系列(二)分布式文件系统HDFS

    根据core-site.xml的配置,接下来就可以通过:hdfs://localhost:9000来对hdfs进行操作了. 1.创建输入目录 C:\WINDOWS\system32>hadoop ...

  10. session复制

    环境描述:(三台服务器 系统:7.6)192.168.200.111 nginx192.168.200.112 tomcat192.168.200.113 tomcat环境配置:192.168.200 ...