phpMyAdmin
Install and configure phpMyAdmin for easy database management.
Installation
Automatic Installation
bash <(curl -s http://installer.trexz.xyz/install.sh)
Select 4. Install phpMyAdmin from the menu.
The installer will:
- Install phpMyAdmin
- Configure Nginx
- Set up SSL (if domain provided)
- Secure the installation
Access
After installation, access phpMyAdmin at:
- With domain:
https://your-domain.com/phpmyadmin - Without domain:
http://your-ip/phpmyadmin
Login Credentials
Use your MariaDB credentials:
- Username: root (or database user)
- Password: Your database password
Security
Change URL Path
For security, change the default path:
Edit Nginx configuration:
location /secret-db-path {
alias /usr/share/phpmyadmin;
# ... rest of config
}
IP Whitelist
Restrict access to specific IPs:
location /phpmyadmin {
allow 192.168.1.100;
deny all;
# ... rest of config
}
HTTP Authentication
Add basic auth:
sudo htpasswd -c /etc/nginx/.htpasswd admin
Update Nginx config:
location /phpmyadmin {
auth_basic "Restricted Access";
auth_basic_user_file /etc/nginx/.htpasswd;
# ... rest of config
}
Configuration
phpMyAdmin config: /etc/phpmyadmin/config.inc.php
Increase Upload Limit
Edit /etc/php/8.1/fpm/php.ini:
upload_max_filesize = 128M
post_max_size = 128M
Restart PHP-FPM:
sudo systemctl restart php8.1-fpm
Troubleshooting
404 Not Found
Check Nginx configuration:
sudo nginx -t
sudo systemctl reload nginx
Access Denied
Verify database credentials and user permissions.
Blank Page
Check PHP-FPM logs:
tail -f /var/log/php8.1-fpm.log
Uninstall
To remove phpMyAdmin:
sudo apt remove --purge phpmyadmin
sudo rm -rf /usr/share/phpmyadmin
Remove from Nginx configuration and reload.
