1:概念
phpmyadmin是一种网络应答式的数据管理系统,在其上面我们可以那里不会点那里的生成我们所需要的代码,也具有很多的功能等待我们去开发。首先,我们看一下他的安装和配置。
2:安装
1:先安装httpd,保证能共享在局域网上。
[root@localhost ~]# yum install httpd -y
Loaded plugins: langpacks
rhel_dvd | 4.1 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-17.el7 will be installed
--> Processing Dependency: httpd-tools = 2.4.6-17.el7 for package: httpd-2.4.6-17.el7.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-17.el7.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-17.el7.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-17.el7.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-17.el7 will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================
Package Arch Version Repository Size
=======================================================================
Installing:
httpd x86_64 2.4.6-17.el7 rhel_dvd 1.2 M
Installing for dependencies:
apr x86_64 1.4.8-3.el7 rhel_dvd 103 k
apr-util x86_64 1.5.2-6.el7 rhel_dvd 92 k
httpd-tools x86_64 2.4.6-17.el7 rhel_dvd 77 k
mailcap noarch 2.1.41-2.el7 rhel_dvd 31 k
Transaction Summary
=======================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 1.5 M
Installed size: 4.3 M
Downloading packages:
(1/5): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00
(2/5): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00
(3/5): httpd-tools-2.4.6-17.el7.x86_64.rpm | 77 kB 00:00
(4/5): mailcap-2.1.41-2.el7.noarch.rpm | 31 kB 00:00
(5/5): httpd-2.4.6-17.el7.x86_64.rpm | 1.2 MB 00:00
-----------------------------------------------------------------------
Total 8.1 MB/s | 1.5 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-3.el7.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-17.el7.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-17.el7.x86_64 5/5
Verifying : mailcap-2.1.41-2.el7.noarch 1/5
Verifying : httpd-tools-2.4.6-17.el7.x86_64 2/5
Verifying : apr-1.4.8-3.el7.x86_64 3/5
Verifying : apr-util-1.5.2-6.el7.x86_64 4/5
Verifying : httpd-2.4.6-17.el7.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-17.el7
Dependency Installed:
apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-17.el7 mailcap.noarch 0:2.1.41-2.el7
Complete!
[root@localhost ~]# systemctl restart httpd
2:切换到http的共享目录 /var/www/html 下,开始配置相关设备。我们先得得到一个包,这个包就是我们所要共享在局域网上的httpmyadmin 的安装包。但是我们会发现我们没这个包,那么,我们就需要使用lftp从局域网上有这个包的机器上下载,在此,我们首先得配置好yum源,下载lftp,如下:
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# ls
[root@localhost html]# lftp 172.25.254.250
bash: lftp: command not found...
[root@localhost html]# yum install lftp -y
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package lftp.x86_64 0:4.4.8-3.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================
Package Arch Version Repository Size
=======================================================================
Installing:
lftp x86_64 4.4.8-3.el7 rhel_dvd 749 k
Transaction Summary
=======================================================================
Install 1 Package
Total download size: 749 k
Installed size: 2.4 M
Downloading packages:
lftp-4.4.8-3.el7.x86_64.rpm | 749 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lftp-4.4.8-3.el7.x86_64 1/1
Verifying : lftp-4.4.8-3.el7.x86_64 1/1
Installed:
lftp.x86_64 0:4.4.8-3.el7
Complete!
3:从172.25.254.250上获取所需要的安装包。
[root@localhost html]# lftp 172.25.254.250
lftp 172.25.254.250:~> ls
drwxr-xr-x 2 0 0 4096 Mar 15 2016 CSA文档
drwxr-xr-x 3 0 0 41 Sep 21 2015 baidu
drwxr-xr-x 4 0 0 4096 Oct 02 2016 docs
drwxr-xr-x 20 0 0 4096 Jun 24 08:46 pub
lftp 172.25.254.250:/> cd pub/
lftp 172.25.254.250:/pub> cd docs
cd ok, cwd=/pub/docs
lftp 172.25.254.250:/pub/docs> cd software/
lftp 172.25.254.250:/pub/docs/software> ls
-rwxr-xr-x 1 1000 1000 3086326 Dec 25 2013 phpMyAdmin-2.11.3-all-languages.tar.bz2
-rwxr-xr-x 1 1000 1000 4548030 Dec 25 2013 phpMyAdmin-3.4.0-all-languages.tar.bz2
-rw-rw-r-- 1 1000 1000 2713600 Jun 07 2015 taobao.tar
-rwxr-xr-x 1 1000 1000 52387876 Feb 01 2015 thunderbird-31.2.0-1.el7.x86_64.rpm
-rwxr-xr-x 1 1000 1000 36902724 Feb 01 2015 thunderbird-31.4.0.tar.bz2
lftp 172.25.254.250:/pub/docs/software> get phpMyAdmin-3.4.0-all-languages.tar.bz2
4548030 bytes transferred
lftp 172.25.254.250:/pub/docs/software> quit
4:对于得到的这个包,我们会惊喜的发现他是一个压缩文件,这时,我们需要对他进行解压。解压后删除原有的压缩文件,分页浏览里面的README,根据指示进行配置。
[root@localhost html]# ls
phpMyAdmin-3.4.0-all-languages.tar.bz2
[root@localhost html]# tar jxf phpMyAdmin-3.4.0-all-languages.tar.bz2 #解压
[root@localhost html]# ls
phpMyAdmin-3.4.0-all-languages phpMyAdmin-3.4.0-all-languages.tar.bz2
[root@localhost html]# rm -fr phpMyAdmin-3.4.0-all-languages.tar.bz2
[root@localhost html]# ls
phpMyAdmin-3.4.0-all-languages
[root@localhost html]# mv phpMyAdmin-3.4.0-all-languages mysqladmin #名字化简
[root@localhost html]# ls
mysqladmin
[root@localhost html]# ls mysqladmin #查看里面文件,里面有readme,那我们就readta
browse_foreigners.php README
bs_disp_as_mime_type.php README.VENDOR
bs_play_media.php RELEASE-DATE-3.4.0
ChangeLog robots.txt
changelog.php schema_edit.php
chk_rel.php schema_export.php
config.sample.inc.php scripts
contrib server_binlog.php
CREDITS server_collations.php
db_create.php server_databases.php
db_datadict.php server_engines.php
db_export.php server_export.php
db_import.php server_import.php
db_operations.php server_privileges.php
db_printview.php server_processlist.php
db_qbe.php server_replication.php
db_search.php server_sql.php
db_sql.php server_status.php
db_structure.php server_synchronize.php
db_tracking.php server_variables.php
docs.css setup
Documentation.html show_config_errors.php
Documentation.txt sql.php
enum_editor.php tbl_addfield.php
export.php tbl_alter.php
favicon.ico tbl_change.php
import.php tbl_chart.php
import_status.php tbl_create.php
index.php tbl_export.php
INSTALL tbl_get_field.php
js tbl_import.php
libraries tbl_indexes.php
LICENSE tbl_move_copy.php
license.php tbl_operations.php
locale tbl_printview.php
main.php tbl_relation.php
navigation.php tbl_replace.php
phpdoctor.ini tbl_row_action.php
phpinfo.php tbl_select.php
phpmyadmin.css.php tbl_sql.php
pmd tbl_structure.php
pmd_common.php tbl_tracking.php
pmd_display_field.php themes
pmd_general.php themes.php
pmd_help.php TODO
pmd_pdf.php transformation_overview.php
pmd_relation_new.php transformation_wrapper.php
pmd_relation_upd.php url.php
pmd_save_pos.php user_password.php
prefs_forms.php view_create.php
prefs_manage.php view_operations.php
print.css webapp.php
querywindow.php
5:根据readme提示,我们需要复制一个文件,给他变名,同时,我们需要将readme里面的一行字符复制到 vim config.sample.inc.php里面,然后进行火墙配置,http开启。
[root@localhost html]# cp config.sample.inc.php config.inc.php
cp: cannot stat ‘config.sample.inc.php’: No such file or directory
[root@localhost html]# cd mysqladmin
[root@localhost mysqladmin]# cp config.sample.inc.php config.inc.php ##按指示做
[root@localhost mysqladmin]# vim config.sample.inc.ph
[root@localhost mysqladmin]# vim config.sample.inc.php
[root@localhost mysqladmin]# less RE
README README.VENDOR RELEASE-DATE-3.4.0
[root@localhost mysqladmin]# less README
[root@localhost mysqladmin]#
[root@localhost mysqladmin]# vim Documentation.txt
[root@localhost mysqladmin]# vim config.sample.inc.php
[root@localhost mysqladmin]# vim config.inc.php
[root@localhost mysqladmin]# vim config.sample.inc.php
[root@localhost mysqladmin]# vim config.inc.php
[root@localhost mysqladmin]# vim config.inc.php
[root@localhost mysqladmin]# systemctl restart httpd
[root@localhost mysqladmin]# systemctl status httpd
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: active (running) since Fri 2017-08-11 02:15:50 EDT; 13s ago
Process: 5924 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Main PID: 5929 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─5929 /usr/sbin/httpd -DFOREGROUND
├─5930 /usr/sbin/httpd -DFOREGROUND
├─5931 /usr/sbin/httpd -DFOREGROUND
├─5932 /usr/sbin/httpd -DFOREGROUND
├─5933 /usr/sbin/httpd -DFOREGROUND
└─5934 /usr/sbin/httpd -DFOREGROUND
Aug 11 02:15:50 localhost systemd[1]: Starting The Apache HTTP Serv....
Aug 11 02:15:50 localhost httpd[5929]: AH00558: httpd: Could not re...e
Aug 11 02:15:50 localhost systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
6:配置完成后,安装php并启动。
[root@localhost mysqladmin]# systemctl stop firewalld.service
[root@localhost mysqladmin]# yum install php -y
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.4.16-21.el7 will be installed
--> Processing Dependency: php-common(x86-64) = 5.4.16-21.el7 for package: php-5.4.16-21.el7.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.4.16-21.el7 for package: php-5.4.16-21.el7.x86_64
--> Running transaction check
---> Package php-cli.x86_64 0:5.4.16-21.el7 will be installed
---> Package php-common.x86_64 0:5.4.16-21.el7 will be installed
--> Processing Dependency: libzip.so.2()(64bit) for package: php-common-5.4.16-21.el7.x86_64
--> Running transaction check
---> Package libzip.x86_64 0:0.10.1-8.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================
Package Arch Version Repository Size
=======================================================================
Installing:
php x86_64 5.4.16-21.el7 rhel_dvd 1.3 M
Installing for dependencies:
libzip x86_64 0.10.1-8.el7 rhel_dvd 49 k
php-cli x86_64 5.4.16-21.el7 rhel_dvd 2.7 M
php-common x86_64 5.4.16-21.el7 rhel_dvd 559 k
Transaction Summary
=======================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 4.7 M
Installed size: 17 M
Downloading packages:
(1/4): libzip-0.10.1-8.el7.x86_64.rpm | 49 kB 00:00
(2/4): php-5.4.16-21.el7.x86_64.rpm | 1.3 MB 00:00
(3/4): php-cli-5.4.16-21.el7.x86_64.rpm | 2.7 MB 00:00
(4/4): php-common-5.4.16-21.el7.x86_64.rpm | 559 kB 00:00
-----------------------------------------------------------------------
Total 20 MB/s | 4.7 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libzip-0.10.1-8.el7.x86_64 1/4
Installing : php-common-5.4.16-21.el7.x86_64 2/4
Installing : php-cli-5.4.16-21.el7.x86_64 3/4
Installing : php-5.4.16-21.el7.x86_64 4/4
Verifying : php-common-5.4.16-21.el7.x86_64 1/4
Verifying : php-cli-5.4.16-21.el7.x86_64 2/4
Verifying : libzip-0.10.1-8.el7.x86_64 3/4
Verifying : php-5.4.16-21.el7.x86_64 4/4
Installed:
php.x86_64 0:5.4.16-21.el7
Dependency Installed:
libzip.x86_64 0:0.10.1-8.el7 php-cli.x86_64 0:5.4.16-21.el7
php-common.x86_64 0:5.4.16-21.el7
Complete!
7:启动之后,我们登录会发现他缺少一个和我们mysql数据库连接的东西,下载并安装。
[root@localhost mysqladmin]# systemctl restart httpd
[root@localhost mysqladmin]# yum search php
Loaded plugins: langpacks
========================== N/S matched: php ===========================
php.x86_64 : PHP scripting language for creating dynamic web sites
php-cli.x86_64 : Command-line interface for PHP
php-common.x86_64 : Common files for PHP
php-gd.x86_64 : A module for PHP applications for using the gd graphics
: library
php-ldap.x86_64 : A module for PHP applications that use LDAP
php-mysql.x86_64 : A module for PHP applications that use MySQL
: databases
php-odbc.x86_64 : A module for PHP applications that use ODBC databases
php-pdo.x86_64 : A database access abstraction module for PHP
: applications
php-pear.noarch : PHP Extension and Application Repository framework
php-pgsql.x86_64 : A PostgreSQL database module for PHP
php-process.x86_64 : Modules for PHP script using system process
: interfaces
php-recode.x86_64 : A module for PHP applications for using the recode
: library
php-soap.x86_64 : A module for PHP applications that use the SOAP
: protocol
php-xml.x86_64 : A module for PHP applications which use XML
php-xmlrpc.x86_64 : A module for PHP applications which use the XML-RPC
: protocol
php-pecl-memcache.x86_64 : Extension to work with the Memcached caching
: daemon
Name and summary matches only, use "search all" for everything.
[root@localhost mysqladmin]# yum install php-mysql.x86_64 -y
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.4.16-21.el7 will be installed
--> Processing Dependency: php-pdo(x86-64) = 5.4.16-21.el7 for package: php-mysql-5.4.16-21.el7.x86_64
--> Running transaction check
---> Package php-pdo.x86_64 0:5.4.16-21.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================
Package Arch Version Repository Size
======================================================================
Installing:
php-mysql x86_64 5.4.16-21.el7 rhel_dvd 96 k
Installing for dependencies:
php-pdo x86_64 5.4.16-21.el7 rhel_dvd 93 k
Transaction Summary
======================================================================
Install 1 Package (+1 Dependent package)
Total download size: 189 k
Installed size: 424 k
Downloading packages:
(1/2): php-mysql-5.4.16-21.el7.x86_64.rpm | 96 kB 00:00
(2/2): php-pdo-5.4.16-21.el7.x86_64.rpm | 93 kB 00:00
----------------------------------------------------------------------
Total 1.6 MB/s | 189 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : php-pdo-5.4.16-21.el7.x86_64 1/2
Installing : php-mysql-5.4.16-21.el7.x86_64 2/2
Verifying : php-mysql-5.4.16-21.el7.x86_64 1/2
Verifying : php-pdo-5.4.16-21.el7.x86_64 2/2
Installed:
php-mysql.x86_64 0:5.4.16-21.el7
Dependency Installed:
php-pdo.x86_64 0:5.4.16-21.el7
Complete!
[root@localhost mysqladmin]# systemctl restart httpd ##重启httpd查看效果
查看效果