Linux运维之道之ENGINEER1.1(配置邮件服务器,数据库管理基础,表数据管理)
2017-11-02 19:53
525 查看
ENGINNEER1.1基础邮件服务
快速部署postfix邮件服务器:
--装包,配置,起服务
安装postfix ;默认已安装
配置postfix,修改配置文件
#ls /etc/postfix/main.cf
#vim /etc/postfix/main.cf
16行 myhostname=server0.example.com #指定主机名
83行 mydomain=example.com #指定域名
99行 myorigin=server0.example.com #默认补全的邮件后缀
116行 inte-interfaces=all #允许所有客户端
164行 mydestination=server0.example.com #判断邮件后缀为本域邮件
3.重启postfix服务,设置开机自启。
#systemctl restart postfix
#systemctl enable postfix
4.测试邮件的收发
#useradd yg
#ehco 123| passwd --stdin yg
mail发信操作:
#mail -s ‘test01‘ -r yg xln
以.结束
收信操作:
#mail -u xln
&1 读取信件内容
--------------------------------------------------------------------------------------------------------------------------
配置server0为空客户端邮件服务器
#vim /etc/postfix/main.cf
99行 myorigin=desktop0.example.com
116行 inet-interfaces=localhost
164行 mydestination=
317行 relayhost =【172.25.0.10】 #指定交给邮件服务器ip地址
#systemctl restart postfix //重启服务
-----------------------------------------------------------------------------------------------------------------------
构建数据库系统安装数据库:
#yum -y install mariadb-service //装包
启服务
#systemctl restart mariadb
#systemctl enable mariadb
#show databases //查看库
#create database //创建库
#drop databases //删除库
#use mysql //使用库
#quit //退出
#desc user //展示表结构
数据库管理员为root,但与系统root没关系
为mysql设置密码:
#mysqladmin -u root password ‘123’
导入/恢复到数据库
格式:
mysql 【-u用户名】【-p【密码】】 数据库名<设备名
#mariadb【nsd】>show tables #查看都有哪些表格
查询操作:
#mysql -u root -p123
>use nsd;
>select * from base;
>select * from location;
>select id,name from base ;
>select * from base where name='tom';
>select * from location where city='Beijing';
授权:
--交互指令:
---gront 权限列表 on 数据库名.表名 to 用户名@localhost identified by ‘密码‘;
---gront select on nsd.* to lisi@localhost identified by '123'; //允许李四查询nsd下所有数据
查看授权信息:
>select user.password from mysql.user;
联合表查询:
nsd>select * from base.location where base.name ='Barara' and location.city='Sunnyvale'and base.id=location.id;
nsd>select count(*) from base.location where base.name ='Barara' and location.city='Sunnyvale'and base.id=location.id;
>insert base values(6,'Barara',123456); //插入表记录
快速部署postfix邮件服务器:
--装包,配置,起服务
安装postfix ;默认已安装
配置postfix,修改配置文件
#ls /etc/postfix/main.cf
#vim /etc/postfix/main.cf
16行 myhostname=server0.example.com #指定主机名
83行 mydomain=example.com #指定域名
99行 myorigin=server0.example.com #默认补全的邮件后缀
116行 inte-interfaces=all #允许所有客户端
164行 mydestination=server0.example.com #判断邮件后缀为本域邮件
3.重启postfix服务,设置开机自启。
#systemctl restart postfix
#systemctl enable postfix
4.测试邮件的收发
#useradd yg
#ehco 123| passwd --stdin yg
mail发信操作:
#mail -s ‘test01‘ -r yg xln
以.结束
收信操作:
#mail -u xln
&1 读取信件内容
--------------------------------------------------------------------------------------------------------------------------
配置server0为空客户端邮件服务器
#vim /etc/postfix/main.cf
99行 myorigin=desktop0.example.com
116行 inet-interfaces=localhost
164行 mydestination=
317行 relayhost =【172.25.0.10】 #指定交给邮件服务器ip地址
#systemctl restart postfix //重启服务
-----------------------------------------------------------------------------------------------------------------------
构建数据库系统安装数据库:
#yum -y install mariadb-service //装包
启服务
#systemctl restart mariadb
#systemctl enable mariadb
#show databases //查看库
#create database //创建库
#drop databases //删除库
#use mysql //使用库
#quit //退出
#desc user //展示表结构
数据库管理员为root,但与系统root没关系
为mysql设置密码:
#mysqladmin -u root password ‘123’
导入/恢复到数据库
格式:
mysql 【-u用户名】【-p【密码】】 数据库名<设备名
#mariadb【nsd】>show tables #查看都有哪些表格
查询操作:
#mysql -u root -p123
>use nsd;
>select * from base;
>select * from location;
>select id,name from base ;
>select * from base where name='tom';
>select * from location where city='Beijing';
授权:
--交互指令:
---gront 权限列表 on 数据库名.表名 to 用户名@localhost identified by ‘密码‘;
---gront select on nsd.* to lisi@localhost identified by '123'; //允许李四查询nsd下所有数据
查看授权信息:
>select user.password from mysql.user;
联合表查询:
nsd>select * from base.location where base.name ='Barara' and location.city='Sunnyvale'and base.id=location.id;
nsd>select count(*) from base.location where base.name ='Barara' and location.city='Sunnyvale'and base.id=location.id;
>insert base values(6,'Barara',123456); //插入表记录
相关文章推荐
- 运维之红帽工程师篇-----2. 配置邮件服务器 、 数据库服务基础 、 管理表数据
- docker学习系列二:数据管理和网络基础配置
- Laxcus大数据管理系统2.0(2)- 第一章 基础概述 1.1 基于现状的一些思考
- SQL语句基础之 管理数据库,表 和 数据
- Dotcms中文教程之一:管理(1.1、数据库配置)
- Laxcus大数据管理系统2.0(2)- 第一章 基础概述 1.1 基于现状的一些思考
- 【java基础:JDBC】通过读取配置文件进行数据库连接并读取数据的Demostration
- 数据库系统原理第一章数据库系统基本概念:1.1 数据管理技术的发展
- 忠实的数据是管理的基础,也是CMMi度量的基础!
- 数据库基础系列之七:IMP数据到指定的表空间
- 基于空间数据库的空间数据管理
- 数据库的用户帐号管理基础知识
- (09) 需求征集 -- 基础编码管理(例如下拉框数据管理)
- 基于数据库的站点导航提供程序,适合一般应用系统的管理后台的快速配置
- 主流数据库之间对SQL:2003标准的不同实现方法比较(第六部分 基础数据类型之BOOLEAN)
- hibernate 配置问题 造成数据库的数据丢失
- VS2008 SP1之“动态数据 Web 应用程序”——管理数据库太容易了!
- AppFramework1.0数据库访问组件使用说明(四)基础数据类型
- MS SQL入门基础:通过视图管理数据
- MS SQL入门基础:数据库更新--添加数据