欢迎投稿

今日深度:

配置phpMyAdmin管理MySQL/MariaDB,phpmyadminmariadb

配置phpMyAdmin管理MySQL/MariaDB,phpmyadminmariadb


背景

CentOS7.x提供的MySQL默认版本已经切换为MariaDB分支,CentOS6.x默认yum源的MySQL版本是5.1.73。CentOS6.x/7.x上安装MySQL/MariaDB需要一套成熟的DB的图形化界面管理系统。本人选定了MySQL流行的管理系统phpMyAdmin,但是phpMyadmin的当前最新版本phpMyAdmin 4.6.4 要求php、MySQL版本,而CentOS6/7本身的源并不提供这样的版本。phpMyAdmin 4.4.15.8-all-languages 版本的对PHP、MySQL有一定要求,但是要求没有4.6.4版本那么高,所以我决定选用phpMyAdmin 4.4.15.8版本。

思路

针对CentOS6.x升级PHP,MySQL要配置外部的源,MySQL如何使用外部源可以参考 CentOS6.x下MySQL版本(5.1.73, 5.7, 5.6)折腾漫谈。安装phpMyAdmin过程,会遇到各种与版本的问题,一般解决方案是升级相关PHP、MySQL版本,或者添加配置库诸如mbstring之类。

步骤

[root@localhost ~]# yum install httpd
[root@localhost ~]# systemctl enable httpd.service

centos7中chkconfig httpd on 被替换成 systemctl enable httpd

[root@localhost ~]# yum install php php-mysql php-devel php-mbstring php-pdo php-cli

写PHP脚本(phpinfo.php)查看安装php的信息

<?php
phpinfo();
?>

将phpinfo.php放置在/var/www/html/ 目录,然后通过访问 ip/phpinfo.php查验php安装信息。

CentOS7.x中把默认MySQL的源替换为了Mariadb(目测某O公司跟Redhat关系呵呵啊),其中部分命令还被替换掉了,诸如启动mariadb的命令就与mysql不一样,当然也可以通过软连接或者其他手段保持命令的一致性,这种情况可能会给出现问题进行解决方案寻找产生麻烦。相关安装启动命令如下:

[root@localhost ~]# yum install mariadb mariadb-server mariadb-libs mariadb-bench mariadb-devel
[root@localhost ~]# systemctl start mariadb.service  
[root@localhost ~]# systemctl enable mariadb.service  

root解压缩phpMyAdmin tar包
/home/huiyong/phpmyadmin.tar.gz
迁移解压缩的文件
mv phpMyAdmin /etc/phpMyAdmin
创建指向phpMyAdmin的软连接
ln -s /etc/phpMyAdmin/ *(最好是乱码,以避免被猜出)
登陆MariaDB管理web页面
ip/**/

5.问题&&解决方案
a. web界面不能访问: 请检查防火墙配置以及SELinux是否放行http访问,可以考虑关闭防火墙,SELinux模块来放行80端口访问。
b. phpmyadmin提示:The mbstring extension is missing. Please check your PHP configuration.
安装php的mbstring扩展模块
yum install php-mbstring
c. CentOS6.x上PHP版本升级需要借助外来源
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
d. Configuration of pmadb… 错误

mysql> create database phpmyadmin;
Query OK, 1 row affected (0.00 sec)

mysql> use phpmyadmin
Database changed
mysql> source ~/phpMyAdmin/sql/create_tables.sql;

e.

其他

1、配置文件现在需要一个短语密码,实际上是给配置cookie加盐,,加强密码管理
a. 打开phpMyAdmin/libraries/config.default.php文件,找到$cfg[‘blowfish_secret’] = ”这一栏,并将这一栏修改为$cfg[‘blowfish_secret’] = ‘*************’; (单引号中的数字是可以随意输入)
b. 进入phpMyAdmin目录,打开config.sample.inc.php这个文件,并通过编辑器打开该文件找到$cfg[‘blowfish_secret’] = ”这一栏,并将这一栏修改为$cfg[‘blowfish_secret’] = ‘***********‘;

2、关于防火墙以及SELinux配置,我们不应该一关了之,只可以作为使用初期为了看到效果的临时手段。
3、phpMyAdmin提供的英文文档值得参考:https://phpmyadmin-english-united-kingdom.readthedocs.io/en/latest/

参考

1、phpMyAdmin官方文档 https://phpmyadmin-english-united-kingdom.readthedocs.io/en/latest/
2、mysqlnd安装 http://zhangxugg-163-com.iteye.com/blog/1894990
3、Mariadb官方文档 https://mariadb.org/learn/
4、MySQL相关文章 http://blog.csdn.net/u012894975/article/details/52268243

www.htsjk.Com true http://www.htsjk.com/mariadb/33279.html NewsArticle 配置phpMyAdmin管理MySQL/MariaDB,phpmyadminmariadb 背景 CentOS7.x提供的MySQL默认版本已经切换为MariaDB分支,CentOS6.x默认yum源的MySQL版本是5.1.73。CentOS6.x/7.x上安装MySQL/MariaDB需要一套成熟的DB的图形...
相关文章
    暂无相关文章
评论暂时关闭