[iyunv@johnson's linux ~]# yum install httpd php php-mysql php-mbstring
========================================================================================
Package Arch Version Repository Size
========================================================================================
Installing:
httpd x86_64 2.4.6-40.el7.centos base 2.7 M
php x86_64 5.4.16-36.el7_1 base 1.4 M
php-mbstring x86_64 5.4.16-36.el7_1 base 503 k
php-mysql x86_64 5.4.16-36.el7_1 base 99 k
# 将包下载并解压至/www/host2/htdoc
# cd 到 文件目录
# 创建符号连接
[iyunv@johnson's linux htdoc]# ln -s phpMyAdmin-4.4.14.1-all-languages myadmin
[iyunv@johnson's linux htdoc]# ls
index.php phpMyAdmin-4.4.14.1-all-languages
myadmin phpMyAdmin-4.4.14.1-all-languages.zip
#cd 至myadmin 目录里面,修改配置文件
[iyunv@johnson's linux htdoc]# cp config.sample.inc.php config.inc.php
#编辑配置文件
[iyunv@johnson's linux htdoc]# vim config.inc.php
$cfg['blowfish_secret'] = 'o71mI9rimj6syc00fT3g'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
#单引号填写随机密码,可使用openssl rand -base64 15(密码长度)生成
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '172.18.17.8'; # 数据库主机ip
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
172.18.17.8主机配置:mysql服务
(1)yum安装程序
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
[iyunv@johnson's linux ~]# yum install mariadb-server
========================================================================================
Installing:
mariadb-server x86_64 1:5.5.44-2.el7.centos base 11 M
Installing for dependencies:
mariadb x86_64 1:5.5.44-2.el7.centos base 8.9 M
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBD-MySQL x86_64 4.023-5.el7 base 140 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
Disallow root login remotely? [Y/n] n # 是否不允许管理员账号远程登陆,一般情况下建议不允许
... skipping.
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.
[iyunv@johnson's linux ~]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 66
Server version: 5.5.44-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.