CentOS 7 安装 mariaDB
1、安装数据库
[root@localhost ~]# yum -y install mariadb-server mariadb mariadb-devel
2、启动数据库
[root@localhost ~]# systemctl start mariadb
[root@localhost ~]# systemctl enable mariadb
3、开通防火墙
[root@localhost ~]# firewall-cmd --permanent --add-service mysql
[root@localhost ~]# systemctl restart firewalld.service
[root@localhost ~]# iptables -L -n|grep 3306
4、修改root用户的密码以及打开远程连接
[root@localhost ~]# mysql -uroot -p
Enter password: //密码默认为空,回车即可
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.50-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
MariaDB [(none)]> use mysql
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";
MariaDB [mysql]> update user set Password = password('123') where User='root';
MariaDB [mysql]> flush privileges; //使设置生效
扩展阅读:
systemctl是RHEL7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。可以使用它永久性或只在当前会话中启用/禁用服务。
启动一个服务:systemctl start postfix.service
关闭一个服务:systemctl stop postfix.service
重启一个服务:systemctl restart postfix.service
显示一个服务的状态:systemctl status postfix.service
在开机时启用一个服务:systemctl enable postfix.service
在开机时禁用一个服务:systemctl disable postfix.service
查看服务是否开机启动:systemctl is-enabled postfix.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed
显示权限:ls -lh
设置目录的所有人(u)、群组(g)以及其他人(o)以读(r )、写(w)和执行(x)的权限:chmod 777 directory1
删除群组(g)与其他人(o)对目录的读写执行权限:chmod 700 directory1
改变一个文件file1的所有人属性为use1:chown user1 file1
改变一个目录的所有人属性并同时改变改目录下所有文件的属性都为use1所有:chown -R user1 directory1
查看磁盘空间大小:
# df -h
# fdisk -l
CentOS 7 安装 mariaDB的更多相关文章
- centos 7 安装mariadb
卸载mysql # rpm -qa|grep mysql mysql-community-common-5.6.30-2.el7.x86_64 mysql-community-libs-5.6.30- ...
- CentOS 7安装MariaDB 10详解以及相关配置
第一步:添加 MariaDB yum 仓库 首先在CentOS操作系统中/etc/yum.repos.d/目录下添加 MariaDB 的YUM配置文件MariaDB.repo文件. vi /etc/y ...
- centos下安装mariadb
前言 一直都是前端,比较少玩服务器,最近买了阿里云,开始尝试centos,不得不说linux还是很有魅力的. 正文 google了一圈,决定安装mariadb,其实mariadb和mysql差不多,使 ...
- centos 7 安装 mariadb数据库
1.安装MariaDB #安装命令yum install mariadb mariadb-server -y#安装完成MariaDB,首先启动MariaDBsystemctl start mariad ...
- ecs CentOS 7 安装 mariadb
检查之前是否已经安装 rpm -qa | grep mariadb 如果已安装,卸载 yum remove mysql mysql-server mysql-libs compat-mysql51 开 ...
- centos yum 安装 mariadb
1. 在 /etc/yum.repos.d/ 下建立 MariaDB.repo,输入内容 [mariadb] name=MariaDB baseurl=http://yum.mariadb.org/1 ...
- CentOS 7.0 使用 yum 安装 MariaDB 与 MariaDB 的简单配置
1.安装MariaDB 安装命令 yum -y install mariadb mariadb-server 安装完成MariaDB,首先启动MariaDB,两条命令都可以 systemctl sta ...
- Centos7 编译安装 Nginx PHP Mariadb Memcached 扩展 ZendOpcache扩展 (实测 笔记 Centos 7.3 + Mariadb 10.1.20 + Nginx 1.10.2 + PHP 7.1.0 + Laravel 5.3 )
环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7-x86_64-Minimal-1611.iso 安装步骤: 1.准备 1.0 查看硬 ...
- Centos 使用YUM安装MariaDB
1.在 /etc/yum.repos.d/ 下建立 MariaDB.repo,内容如下: [azureuser@mono etc]$ cd /etc/yum.repos.d [azureuser@mo ...
随机推荐
- 【转】C#路径/文件/目录/I/O常见操作汇总
文件操作是程序中非常基础和重要的内容,而路径.文件.目录以及I/O都是在进行文件操作时的常见主题,这里想把这些常见的问题作个总结,对于每个问题,尽量提供一些解决方案,即使没有你想要的答案,也希望能提供 ...
- 字符串做异或使用union
#include <stdio.h> #include <sys/time.h> #include <string.h> union data { unsigned ...
- install ruby and ruby gem
sudo apt-get install ruby #find an folder and: git clone https://github.com/rubygems/rubygems.git cd ...
- NGUI系列教程九(自制ListView)
在NGUI中可以很方便的实现ListView的控件,ListView就好比IOS或Android平台中使用手势上下拖动的控件.在Unity3D中实现ListView的原理无非就两种,第一种是摄像机不动 ...
- SQL 跨服务器数据库增、删、改、查(一)
--开启本服务器中操作其他服务器的功能 reconfigure --输出消息 reconfigure --输出消息 --增 INSERT INTO OPENROWSET('SQLOLEDB','jx3 ...
- 【BZOJ2330】 [SCOI2011]糖果
Description 幼儿园里有N个小朋友,lxhgww老师现在想要给这些小朋友们分配糖果,要求每个小朋友都要分到糖果.但是小朋友们也有嫉妒心,总是会提出一些要求,比如小明不希望小红分到的糖果比他的 ...
- Any Way You Slice It (向量旋转 以及 判断线段是否相交)(模板)
http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11353 #include<iostream> # ...
- Matlab中添加搜索目录
一.问题来源 来自于一份大规模hash图像检索代码. 二.问题解析 2.1 添加目录 addpath('./utils/'); 2.2 添加目录及其子目录 addpath(genpath('./uti ...
- ITQ迭代量化方法解析
一.问题来源 来源于换关键字,从LSH转换为hash检索,这要感谢李某. 二.解析 笔者认为关键思想是数据降维后使用矩阵旋转优化,其他和LSH一样的. 2.1 PCA降维 先对原始空间的数据集 X∈R ...
- spoj 2148
看似很水 却wa了好多遍 spoj上果然没有一下可以水过去的题....... #include<cstdio> #include<cstring> #include< ...