# Database Access Configuration
This guide covers advanced database access configuration for PanelAlpha, including setting up phpMyAdmin and troubleshooting database connectivity issues.
# phpMyAdmin Installation
phpMyAdmin provides a web-based interface for managing your PanelAlpha database.
# Installation Process
- Access your server via SSH with root privileges:
ssh root@your-server-ip - Install phpMyAdmin using Docker:
docker run --name appphpmyadmin -d --link app-database-api-1 -p 7070:80 --network app_default -e PMA_HOST=database-api.palocal phpmyadmin
# Command Parameters Explained
--name appphpmyadmin: Sets the container name for easy management-d: Runs the container in detached mode (background)--link app-database-api-1: Links to the PanelAlpha database container-p 7070:80: Maps phpMyAdmin to port 7070 on your server--network app_default: Uses the PanelAlpha Docker network-e PMA_HOST=database-api.palocal: Sets the database host
# Optional Parameters
You can add the --rm parameter for temporary access:
docker run --rm --name appphpmyadmin -d --link app-database-api-1 -p 7070:80 --network app_default -e PMA_HOST=database-api.palocal phpmyadmin
--rm: Automatically removes the container when stopped. Use this for temporary database access.
# Accessing phpMyAdmin
# Web Access
- Open your web browser.
- Navigate to:
http://YOUR_SERVER_IP:7070 - Use your database credentials to log in.
Example: If your server IP is 192.168.1.100, access: http://192.168.1.100:7070
# Custom Port Configuration
If port 7070 is already in use, change it to an available port:
# Using port 8080 instead
docker run --name appphpmyadmin -d --link app-database-api-1 -p 8080:80 --network app_default -e PMA_HOST=database-api.palocal phpmyadmin
# Database Connection Troubleshooting
# Common Connection Issues
# Container Not Found
Error: Cannot link to container
Solution:
- Verify the database container is running:
docker ps | grep database - Check the correct container name:
docker ps --format "table {{.Names}}\t{{.Status}}"
# Port Already in Use
Error: Port 7070 is already allocated
Solution:
- Check which process is using the port:
netstat -tulpn | grep 7070 - Use a different port or stop the conflicting service.
# Network Issues
Error: Cannot connect to network
Solution:
- Verify the Docker network exists:
docker network ls | grep app_default - Restart the PanelAlpha containers if needed.
# Database Credentials
Default database connection details for the PanelAlpha application database:
- Host:Port:
database-api.palocal:3306(internal Docker network hostname) - Username:
panelalpha(theDB_USERNAMEkey in/opt/panelalpha/app/.env-api) - Password: the value of
API_MYSQL_PASSWORDfrom/opt/panelalpha/app/.env. This password is injected into the containers by docker-compose; in.env-apitheDB_PASSWORD=field is intentionally left empty. - Database:
panelalpha
To connect from outside the containers, use the database-api service directly:
docker compose -f /opt/panelalpha/app/docker-compose.yml exec database-api mariadb -u panelalpha -p
Note: The phpMyAdmin instance shipped with PanelAlpha is used for SSO access to customer databases hosted on hosting servers — it is not intended for managing the PanelAlpha application's own database. Use the CLI command above for application database access.
# Container Management
# Managing the phpMyAdmin Container
Start the container:
docker start appphpmyadmin
Stop the container:
docker stop appphpmyadmin
Remove the container:
docker rm appphpmyadmin
View container logs:
docker logs appphpmyadmin
# Security Considerations
# Access Control
- Restrict access by IP address if possible.
- Use firewall rules to limit port 7070 access.
- Remove phpMyAdmin when not needed for security.
- Use strong database passwords.
# Temporary Access
For security, consider using the --rm flag for temporary database access:
# Temporary access - container removes itself when stopped
docker run --rm --name temp-phpmyadmin -d --link app-database-api-1 -p 7070:80 --network app_default -e PMA_HOST=database-api.palocal phpmyadmin
# Alternative Database Access
# Command Line Access
Access the database directly via command line:
# Access MySQL/MariaDB directly
docker compose -f /opt/panelalpha/app/docker-compose.yml exec database-api mysql -u root -p
# Database Backup
Create database backups for troubleshooting:
# Create a database backup
docker compose -f /opt/panelalpha/app/docker-compose.yml exec database-api mysqldump -u root -p panelalpha > backup.sql
# Common Issues
# phpMyAdmin Not Loading
Problem: The phpMyAdmin interface does not load in the browser when accessing it through PanelAlpha.
Solution:
- Check if the container is running:
docker ps - Verify port accessibility:
telnet your-server-ip 7070 - Check container logs:
docker logs appphpmyadmin
# Database Connection Failed
Problem: PanelAlpha or phpMyAdmin cannot connect to the database, causing errors during operations.
Solution:
- Verify the database container is running.
- Check network connectivity between containers.
- Verify database credentials.
# Performance Issues
Problem: phpMyAdmin or database operations are slow or unresponsive, especially with large datasets.
Solution:
- Allocate more resources to the phpMyAdmin container.
- Check server resource usage.
- Consider using command-line tools for large operations.
# Getting Help
If you encounter database access issues:
- Check the Common Error Solutions guide.
- Review Docker and database logs for error messages.
- Contact our support team (opens new window) for assistance.