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 ...
随机推荐
- CSS:CSS 分组 和 嵌套 选择器
ylbtech-CSS:CSS 分组 和 嵌套 选择器 1.返回顶部 1. CSS 分组 和 嵌套 选择器 Grouping Selectors 在样式表中有很多具有相同样式的元素. h1 { col ...
- python re模块使用
re.findall() 查找字符 从字符串中找出符合模式的字符序列:findall(模式(正则表达式),目标字符串), 返回值为list类型,list元素为匹配出的各个字符串如: import re ...
- Mysql数据库命令行输入错误怎么办
Mysql数据库命令行输入错误 缺少另一半 错误输入 ' 或 " 时,必须键入另一半才能退出命令. 缺少分号 写入语句缺少分号需要补全. 输入quit或者exit退出 ctrl+c,完全退出 ...
- 在Linux下编译带调试功能的Bochs
在Linux下使用Bochs参考: http://wangcong.org/articles/bochs.html http://kinglaw05.blog.163.com/blog/static/ ...
- Java目录事件
当文件系统中的对象被修改时,我们可以监听watch服务以获取警报.java.nio.file包中的以下类和接口提供watch服务. Watchable接口 WatchService接口 WatchKe ...
- ThinkPHP5实用的数据库操作方法
1.update方法总结 /** * 设置记录的某个字段值 * 支持使用数据库字段和方法 * @access public * @param string|array $field 字段名 * @pa ...
- 换盘符cd的用法
如果是在本盘内切换文件夹,直接使用cd 后面跟地址即可. 如果是跨区切换地址,cd 后面就需要跟/d,斜杠d, /d就代表着跨分区切换地址. cd /d d:\ C:\ProgramData\Anac ...
- echarts点击柱状图时触发点击事件
项目需求:1.通过echarts把数据展示为柱状图2.点击对应的柱状图 显示对应的弹窗 主要用到的时 echarts中的 "click" 事件, 使用demo: var myCha ...
- Jmeter-【JSON Extractor】-响应结果中二级key取值
一.请求返回样式 二.取chapter的值 三.查看结果
- Windows API DOC
{ /* https://docs.microsoft.com/zh-cn/?view=sql-server-ver15 */ }