良许Linux教程网 干货合集 Linux搭建phpMyAdmin具体步骤

Linux搭建phpMyAdmin具体步骤

phpMyAdmin是一个非常受欢迎的基于web的MySQL数据库管理工具。它能够创建和删除数据库,创建/删除/修改表格,删除/编辑/新增字段,执行SQL脚本等,本篇文章重点为大家讲解一下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

在Linux搭建phpMyAdmin在Linux搭建phpMyAdmin

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在Linux搭建phpMyAdmin

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部