Adminer 是一个用 PHP 编写的基于网络的数据库管理工具。它可以管理 MySQL、PostgreSQL、Sqlite3、MS SQL、Oracle 数据库和 Elasticsearch。
它是 PhpMyAdmin 的一个更简单的替代方案。你可以在官方网站页或 Wikipedia 找到更多关于这个项目的信息。
安装
安装 adminerAUR 软件包或下载 Adminer,然后将其手动放置在 document-root 中。
使用 adminerAUR 软件包时,Adminer 将安装为 /usr/share/webapps/adminer/index.php。
确保未注释 /etc/php/php.ini 中的正确扩展,例如,extension=pdo_mysql 会提供 MySQL 数据库管理。
配置
Apache
注意:确保Apache 的 PHP 扩展已正确配置
在 /etc/httpd/conf/httpd.conf 中添加以下一行:
Include conf/extra/httpd-adminer.conf
然后重启你的 Apache HTTP 服务器守护进程。
现在可以通过浏览 http://localhost/adminer 访问 Adminer。
Nginx
注意:确保已正确配置PHP FastCGI 接口。
以 root 权限使用/usr/share/webapps/adminer 创建 server entry:
/etc/nginx/sites-available/adminer.conf
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name adminer.domain;
root /usr/share/webapps/adminer;
# Only allow certain IPs
#allow 192.168.1.0/24;
#deny all;
index index.php;
location / {
try_files $uri $uri/ =404;
}
error_page 404 /index.php;
# PHP configuration
location ~ \.php$ {
...
}
}
将 adminer.conf 符号链接到 sites-enabled 并重启 nginx。
Hiawatha
确保正确配置PHP FastCGI 接口。
然后在 /etc/hiawatha/hiawatha.conf 中添加以下 VirtualHost 块。
/etc/hiawatha/hiawatha.conf
VirtualHost {
# If you set WebsiteRoot to /usr/share/webapps/adminer you do not need followsymlinks
# I symlinked the adminer folder to '/srv/http/adminer' so that I can easily remember where it's located but
# still set 'WebsiteRoot' to the real source directory. You could point WebsiteRoot to the
# symlinked directory, but you will have to set 'FollowSymlinks = yes' for that to function properly
Hostname = db.domainname.dom
#FollowSymlinks = yes
#WebsiteRoot = /srv/http/adminer
WebsiteRoot = /usr/share/webapps/adminer
AccessLogfile = /var/log/hiawatha/adminer/access.log
ErrorLogfile = /var/log/hiawatha/adminer/error.log
StartFile = index.php
UseFastCGI = PHP7
}
然后重启 hiawatha.service。