标签:phpmyadmin
phpMyAdmin安装记录
时间:2017年9月20日
一、phpMyAdmin简介:
phpMyAdmin,是MySQL或MariaDB数据库的GUI管理工具,以php为基础,以web为工作形式。
二、phpMyAdmin安装:
2-1:LAMP环境准备
IP:192.168.1.71;
Hostname:centos73-2.surmount.net;
Linux:CentOS Linux release 7.3.1611 (Core);
Apache:httpd-2.4.6;
Mysql:Ver 15.1 Distrib 5.5.52-MariaDB;
PHP:ISO光盘yum源初始安装为php-5.4.16,
在安装phpMyAdmin-4.7.4报错提示后按需要升级为php56w-5.6.31。
2-1-1:安装及配置MariaDB
# yum install mariadb-server -y # systemctl start mariadb.service # mysql MariaDB [(none)]> SET PASSWORD FOR ‘root‘ @‘127.0.0.1‘=PASSWORD(‘jingpei‘); MariaDB [(none)]> SET PASSWORD FOR ‘root‘ @‘localhost‘=PASSWORD(‘jingpei‘); MariaDB [(none)]> FLUSH PRIVILEGES;
//设置DB的root用户密码
2-1-2:安装及配置Apache
# yum install httpd -y # systemctl start httpd.service # vim /etc/httpd/conf/httpd.conf ServerName centos73-2.surmount.net:80 # httpd -t Syntax OK # systemctl reload httpd.service
http://192.168.1.71
//测试html页面
OK
2-1-3:安装PHP
# yum install php php-mysql -y # vim /var/www/html/index.php <?php $link = mysql_connect(‘localhost‘, ‘mysql‘, ‘‘); if (!$link) { die(‘Could not connect: ‘ . mysql_error()); } echo ‘Connected successfully‘; mysql_close($link); phpinfo() ?>
http://192.168.1.71/index.php
//测试php页面,测试DB连接
OK
2-2:安装phpMyAdmin
2-2-1:安装
# unzip phpMyAdmin-4.7.4-all-languages.zip # cp -a phpMyAdmin-4.7.4-all-languages /var/www/html # ln -sv phpMyAdmin-4.7.4-all-languages pma # cd /var/www/html/pma # cp config.sample.inc.php config.inc.php # tr -d ‘a-zA-Z0-9‘ < /dev/urandom | head -30 | md5sum 8b2c0e4f280fb8cab9ff8b2716cf7a40 - # vim config.inc.php ...... $cfg[‘blowfish_secret‘] = ‘8b2c0e4f280fb8cab9ff8b2716cf7a40‘; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ ...... http://192.168.1.71/pma status code:500
2-2-1:排错
# vim /etc/php.ini ...... display_errors Default Value: On ...... error_reporting Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED ......
//开启PHP报错
# systemctl reload httpd.service http://192.168.1.71/pma/ Parse error: syntax error, unexpected ‘@‘ in /var/www/html/phpMyAdmin-4.7.4-all-languages/libraries/common.inc.php on line 467 # cat /var/www/html/pma/libraries/common.inc.php 467 if (@extension_loaded(‘mbstring‘) && !empty(@ini_get(‘mbstring.func_overload‘))) { 468 PMA_fatalError( 469 __( 470 ‘You have enabled mbstring.func_overload in your PHP ‘ 471 . ‘configuration. This option is incompatible with phpMyAdmin ‘ 472 . ‘and might cause some data to be corrupted!‘ 473 ) 474 ); 475 } # wget -O /etc/yum.repos.d/CentOS-Base-Ali.repo http://mirrors.aliyun.com/repo/Centos-7.repo # sed -i ‘s/$releasever/7/g‘ /etc/yum.repos.d/CentOS-Base-Ali.repo # yum install php-mbstring -y # systemctl reload httpd.service http://192.168.1.71/pma/
//提示错误相同,暂时注释掉common.inc.php的467-475行,待完成php升级后再取消注释。
# systemctl reload httpd.service
http://192.168.1.71/pma/
PHP 5.5+ is required.
Currently installed version is: 5.4.16
//提示php版本低
# yum list installed | grep php php.x86_64 5.4.16-42.el7 @iso php-cli.x86_64 5.4.16-42.el7 @iso php-common.x86_64 5.4.16-42.el7 @iso php-mbstring.x86_64 5.4.16-42.el7 @base php-mysql.x86_64 5.4.16-42.el7 @iso php-pdo.x86_64 5.4.16-42.el7 @iso # yum remove php php-cli php-common php-mbstring php-mysql php-pdo -y # yum list php*
//无可用源,故安装webtatic第三方yum源
# rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # yum install php56w -y # systemctl reload httpd.service
http://192.168.1.71/pma/
//缺少mbstring扩展
# wget http://repo.webtatic.com/yum/el7/x86_64/RPMS/php56w-mbstring-5.6.31-1.w7.x86_64.rpm # rpm -ivh php56w-mbstring-5.6.31-1.w7.x86_64.rpm # systemctl reload httpd.service
http://192.168.1.71/pma/
//缺少mysqli扩展
# yum install php56w-mysql -y # systemctl reload httpd.service # httpd -M | grep php php5_module (shared)
http://192.168.1.71/pma/
OK
完成安装,基于鼠标流的操作不再敖述。
本文出自 “你好,CTO。” 博客,请务必保留此出处http://200622925.blog.51cto.com/13331171/1967656
标签:phpmyadmin
原文地址:http://200622925.blog.51cto.com/13331171/1967656