欢迎光临
我们一直在努力

Linux如何搭建phpMyAdmin - 开发技术

本文小编为大家详细介绍“Linux如何搭建phpMyAdmin”,内容详细,步骤清晰,细节处理妥当,希望这篇“Linux如何搭建phpMyAdmin”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。

RHEL/CentOS:(下面以CentOS7.6为例)

我们先来搞定一些先决条件

关闭selinux并重启系统生效

# sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config && shutdown -r now

然后我们安装phpMyAdmin需要的php扩展

# yum install php73-php-mysqlnd.x86_64 php73-php-mbstring.x86_64 -y# chown -R nginx:nginx /var/opt/remi/php73/lib/php/

重启php

# systemctl restart php73-php-fpm.service

下载phpMyAdmin源代码

# wget https://files.phpmyadmin.net/phpMyAdmin/4.9.0.1/phpMyAdmin-4.9.0.1-all-languages.zip

安装zip,并解压下载的源代码

# yum install zip unzip -y && unzip phpMyAdmin-4.9.0.1-all-languages.zip

移动phpMyAdmin源代码到网页目录下并把权限设置为nginx

# mv phpMyAdmin-4.9.0.1-all-languages /usr/share/nginx/html/phpMyAdmin && chown -R nginx:nginx /usr/share/nginx/html/phpMyAdmin

配置phpMyAdmin的短语密码

# sed -i "108 s/''/'自己随机生成32为密码就行'/g" /usr/share/nginx/html/phpMyAdmin/libraries/config.default.php

示例:

# sed -i "108 s/''/'M4HUkD8rwVPo919e36Rp5zItiPqprByh'/g" /usr/share/nginx/html/phpMyAdmin/libraries/config.default.php

我们打开网页登录phpMyAdmin,创建phpmyadmin数据库,看下面的gif动态图,登录→查找原因→创建

http://IP地址/phpMyAdmin/index.php

Debian/Ubuntu:(下面以Debian10为例)

我们先来搞定一些先决条件

安装phpMyAdmin需要的php扩展

# apt install php7.3-mysql php7.3-mbstring -y

下载phpMyAdmin源代码

# wget https://files.phpmyadmin.net/phpMyAdmin/4.9.0.1/phpMyAdmin-4.9.0.1-all-languages.zip安装zip,并解压下载的源代码# apt install zip unzip -y && unzip phpMyAdmin-4.9.0.1-all-languages.zip

移动phpMyAdmin源代码到网页目录下并把权限设置为nginx

# mv phpMyAdmin-4.9.0.1-all-languages /usr/share/nginx/html/phpMyAdmin && chown -R nginx:nginx /usr/share/nginx/html/phpMyAdmin

配置phpMyAdmin的短语密码

# sed -i "108 s/''/'自己随机生成32为密码就行'/g" /usr/share/nginx/html/phpMyAdmin/libraries/config.default.php

示例:

# sed -i "108 s/''/'M4HUkD8rwVPo919e36Rp5zItiPqprByh'/g" /usr/share/nginx/html/phpMyAdmin/libraries/config.default.php

我们打开网页登录phpMyAdmin,创建phpmyadmin数据库,看下面的gif动态图,登录→查找原因→创建

http://IP地址/phpMyAdmin/index.php

读到这里,这篇“Linux如何搭建phpMyAdmin”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注云行业资讯频道。

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。