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 ...
随机推荐
- Openstack 中的消息总线 & AMQP
目录 目录 消息总线 消息总线的原理 AMQP 消息总线 Openstack 采用了面向服务的开发模式(有别于面向对象和面向过程),需要我们去考虑各个服务之间和各项目之间是如何传递消息的. Restf ...
- Windows 7旗舰版产品密钥
http://www.xitongcheng.com/jiaocheng/win7_article_45903.html 一.Windows 7旗舰版产品密钥 零售版: Windows 7 Ultim ...
- java有序列表
关于有序和无序的定义: 有序:有序列表中的元素具有某种内在的关联,这种关联定义了列表之间的顺序 无序:无序列表中的元素按使用者所选择得任意方式排序 索引:索引列表为他的元素维护一段连续的数字索引值 有 ...
- C#比较时间大小(时分)
比较时间大小(时分) string st1="12:13"; string st2="14:14"; DateTime dt1=Convert ...
- Java 并发之原子性与可见性
原子性 原子是世界上的最小单位,具有不可分割性.比如 a=0:(a非long和double类型) 这个操作是不可分割的,那么我们说这个操作时原子操作.再比如:a++: 这个操作实际是a = a + 1 ...
- C-Ubuntu中MySQL出现ERROR1698(28000):Access denied for user root@localhost错误解决方法
卸载原先的MySQL,重新安装过程中没有提示设置密码, 当键入命令:mysql -uroot -p; 不知密码是什么,输入主机的密码以及不输入密码,回车后都出现标题错误. 寻找多篇相关博文,验证如下博 ...
- 3-Windows-CMD启动mysql服务-连接本地mysql服务-连接远程mysql服务
转自: https://jingyan.baidu.com/article/84b4f565b77a5660f6da32d4.html 备注: 如果在连接远程mysql服务,无法连接时,可能是远程my ...
- Jmeter-Json提取器、用户定义变量配置
一.Jmeter用户定义的变量,一般用于配置全局变量 1.选择用户定义的变量菜单 2.配置需要的用户定义变量 这里我添加常用的localhost和port 3.如何使用 需要使用${...}进行引用 ...
- Shell case in语句详解
和其它编程语言类似,Shell 也支持两种分支结构(选择结构),分别是 if else 语句和 case in 语句.在<Shell if else>一节中我们讲解了 if else 语句 ...
- springboot java.util.NoSuchElementException: No value present 异常处理
使用jpa查询的时候,如果查询不到数据,就会返回这个错误,下面是处理方法. @Override public User findByEmail(String email) { User user = ...