Fedora25安装mariadb并设置权限
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并设置权限的更多相关文章
- centos7下安装mysql8.0.12及设置权限
一.mysql版本介绍 mysql的官网为:https://www.mysql.com/ 在官网上可以看到多个版本,主要版本如下, 1.MySQL Community Server 社区版本,开源免费 ...
- CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置
1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB,两条命令都可以 systemctl sta ...
- Linux下编译安装MariaDB
MariaDB是MySQL的一个开源分支,主要是社区在维护,并且完全兼容MySQL,并且可以很方便的称为MySQL的替代,MariaDB的诞生正是出自MySQL创始人Michael Widenius之 ...
- Centos 使用YUM安装MariaDB
1.在 /etc/yum.repos.d/ 下建立 MariaDB.repo,内容如下: [azureuser@mono etc]$ cd /etc/yum.repos.d [azureuser@mo ...
- 安装MariaDB和简单配置
1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB systemctl start maria ...
- 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 显示系统版 ...
- Centos6.6下安装MariaDB步骤,利用yum进行安装 第二篇
一.安装过程参考的相关文章: Centos 使用YUM安装MariaDB CentOS安装并设置MariaDB CentOS用yum安装.配置MariaDB MariaDB远程连接配置 ERROR 1 ...
- Linux下使用yum安装MariaDB
版本:centos7 Linux下安装MariaDB官方文档参见:https://mariadb.com/kb/zh-cn/installing-mariadb-with-yum/ 1.创建Maria ...
- 在centos上编译安装mariadb数据库
一.安装前提(准备数据文件.安装其他依赖的软件) 1.准备数据存放的目录 [root@localhost ~]# fdisk /dev/sdb (fdisk /dev/sdb 创建一个逻辑分区/de ...
随机推荐
- 1.4 React 组件生命周期
1.4.1 组件 React 中组件有自己的生命周期方法,简单理解可以为组件从 出生(实例化) -> 激活 -> 销毁 生命周期 hook.通过这些 hook 方法可以自定义组件的特性. ...
- 【转载】Jmeter业务请求比例1
ps:文章转自订阅号“测试那点事儿”,链接:https://mp.weixin.qq.com/s/qVD4iNO0QqRIwAIq9_E_Kw 在进行综合场景压测时,由于不同的请求,要求所占比例不同, ...
- Elasticsearch索引别名使用
背景 项目中使用的老的索引,由于数据冗余,会想影响性能.因此需要重新建立索引,但是这样必然需要更新服务中的索引名称,然后重新启动服务,可能会对服务的使用者产生一定的影响.因此,调研了Elasticse ...
- C#获取系统服务+进程+启动时间
原文:C#获取系统服务+进程+启动时间 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/weixin_38208401/article/details ...
- PyQt5初识
学习PyQt5是个机缘,那是因为我的linux16.04+python3.6使了浑身解数也装不上PyQt4! PyQt5的官方文档貌似是要钱的!又想快速了解这个东东,我还是借鉴了万能的博客园大佬博主: ...
- android项目各个文件详解
res目录说明 android应用的res目录是一个特殊的目录,该项目里存放了 android应用所用的全部资源,包括图片资源.字符串资源. 颜色资源.尺寸资源等. /res/value/string ...
- true - (成功的)什么都不做
总览 (SYNOPSIS) true [忽略命令行参数] true OPTION 描述 (DESCRIPTION) 程序 结束 时, 产生 表示 成功 的 状态码. 下列的 选项 没有 简写 形式. ...
- Java利用MD5WithRSA签名及DESede加密
前言:近期公司做数据加密及签名,整理如下: 一.数字签名. 是只有信息的发送者才能产生的别人无法伪造的一段数字串,具有不可抵赖性,可验证信息完整性的一种手段. 签名不可伪造:其他人因为没有对应的私钥, ...
- 预防定时重启apache服务没有起来的脚本
内容如下: #!/bin/bash test=$(ps aux | grep httpd | grep -v grep) if [ -n "$test" ] then echo & ...
- C++11 auto 与 右值
auto: auto T = xxx; // 产生一个变量,自动推导变量类型. 存在变量拷贝的消耗.auto& T = xxx; // 产生一个变量的引用,自动推导变量类型.减少拷贝的消耗. ...