ENGINNEER1.1
Basic Mail Service
Quickly deploy Postfix mail servers:
--pack, configure, serve
install postfix; default installed
configuring postfix, modifying configuration files
#ls/ETC/POSTFIX/MAIN.CF
#vim/ETC/POSTFIX/MAIN.CF
16 Rows myhostname=server0.example.com #指定主机名
83 Rows mydomain=example.com #指定域名
99 rows myorigin=server0.example.com #默认补全的邮件后缀
116 rows Inte-interfaces=all #允许所有客户端
164 rows mydestination=server0.example.com #判断邮件后缀为本域邮件
3. Restart the Postfix service and set the boot to start.
#systemctl restart Postfix
#systemctl Enable Postfix
4. Test Mail Sending and receiving
#useradd YG
#ehco 123| passwd--stdin YG
Mail operation:
#mail-S ' test01 '-R YG Xln
End With.
Receiving operation:
#mail-U XLN
&1 reading the contents of a letter
--------------------------------------------------------------------------------------------------------------- -----------
Configuring SERVER0 as a null client mail server
#vim/ETC/POSTFIX/MAIN.CF
99 Row myorigin=desktop0.example.com
116 Row Inet-interfaces=localhost
164 Row Mydestination=
317 Rows Relayhost = "172.25.0.10" #指定交给邮件服务器ip地址
#systemctl restart Postfix //Restart service
--------------------------------------------------------------------------------------------------------------- --------
Building a database system
To install the database:
#yum-y Install mariadb-service // Pack
Start-up service
#systemctl Restart MARIADB
#systemctl Enable MARIADB
#show databases //View Gallery
#create database //create library
#drop databases //delete library
#use MySQL //Use library
#quit //Exit
#desc user //display table structure
The database administrator is root, but it doesn't matter to the system root
To set a password for MySQL:
#mysqladmin-u root password ' 123 '
Import/Restore to Database
Format:
MySQL "-u user Name" "-P" password "" Database name < device name
#mariadb "NSD" >show tables #查看都有哪些表格
Query operation:
#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 ';
Authorized:
--Interactive instruction:
---The Gront permission list on the database name. Table name to user name @localhost identified by ' password ';
---gront select on nsd.* to [e-mail protected] identified by ' 123 '; //Allow John Doe to query NSD all data
To view authorization information:
>select User.password from Mysql.user;
Union Table query:
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); //Insert Table record
This article is from the Linux OPS blog, so be sure to keep this source http://13401400.blog.51cto.com/13391400/1978529
Linux Operations ENGINEER1.1 (configure mail server, database management base, table data Management)