*.*表示数据库所有表格
GREATE USER [email protected]‘%‘表示在任何数据库都可建立(前提数据库端口都开放)
GREATE USER [email protected]‘localhost‘表示本机可以创建
SELECT * FROM mysql.user; 需在root用户下查询
注意:授权必须在root用户下进行操作;
修改密码(密码已知)
125 mysqladmin -uroot -predhat password westos
126 mysql -uroot -predhat
127 mysql -uroot -pwestos
数据库登陆密码忘记,重置密码:(密码未知)
128 systemctl stop mariadb
130 mysqld_safe --skip-grant-tables &
131 mysql -uroot
重新设定密码
132 fg
133 killall -9 mysqld_safe --skip-grant-tables
134 killall -9 mysqld_safe
135 ps aux | grep mysql
136 kill -9 2705
137 ps aux | grep mysql
138 systemctl start mariadb
139 mysql -uroot -predhat
数据库图形管理:
159 yum install httpd -y
160 systemctl status firewalld.service
161 firewall-cmd --permanent --add-service=http
162 firewall-cmd --reload
163 systemctl start httpd
164 cd /var/www/html/
165 ls
166 vim index.html
167 lftp 172.25.254.250
168 yum install lftp -y
169 lftp 172.25.254.250
170 ls
171 tar -jxf phpMyAdmin-3.4.0-all-languages.tar.bz2 解压php安装包
172 ls
173 mv phpMyAdmin-3.4.0-all-languages myadmin 重命名(名字任意)
174 ls
175 yum install php -y 安装php服务
176 systemctl restart httpd.service 重启httpd
177 cd myadmin/
178 ls
179 rpm -qa | grep php 查看php版本
180 rpm -qa | grep mariadb 查看mariadb版本
181 cp -p config.sample.inc.php config.inc.php
182 vim config.inc.php
183 yum install php-mysql.x86_64 -y
184 systemctl restart httpd.service
在浏览器中搜索172.25.254.117/myadmin
登陆用户(root)密码
进行操作
收发邮件:
先配置dns
1 hostnamectl set-hostname maillinux.linux.com 服务器server
2 vim /etc/sysconfig/network-scripts/ifcfg-eth0
3 vim /etc/yum.repos.d/rhel_dvd.repo
4 reboot
5 yum install bind -y
6 vim /etc/named.conf
# Generated by NetworkManager
domain example.com
search example.com linux.com
nameserver 172.25.254.117
7 vim /etc/named.rfc1912.zones
8 cd /var/named/
9 ls
10 cp -p named.localhost westos.com.zone
11 vim westos.com.zone
12 cp -p westos.com.zone linux.com.zone
13 vim linux.com.zone
14 systemctl restart named
15 vim /etc/resolv.conf
16 systemctl stop firewalld.service
17 systemctl restart named
18 vim westos.com.zone
19 cd
20 systemctl restart named
21 dig -t mx westos.com
22 dig -t mx linux.com
1 hostnamectl set-hostname mailwestos.westos.com 服务器client
2 vim /etc/sysconfig/network-scripts/ifcfg-eth0
3 vim /etc/yum.repos.d/rhel_dvd.repo
4 reboot
5 vim /etc/resolv.conf
# Generated by NetworkManager
domain example.com
search example.com westos.com
nameserver 172.25.254.117
6 dig -t mx westos.com
7 dig -t mx linux.com
104 postconf -e "inet_interfaces=localhost" 更改
105 vim /etc/postfix/main.cf
vim generic
89 postmap generic
90 ls
91 postconf -d | grep generic
92 postconf -e "smtp_generic_maps = hash:/etc/postfix/generic"
93 systemctl restart postfix.service