How to create and manage MySQL databases in aaPanel
Create and manage MySQL databases in aaPanel on an UnderHost VPS or dedicated server, including users, phpMyAdmin, imports, exports, backups,
On this page
aaPanel manages MySQL databases through the Database section. You can create databases, manage users, access phpMyAdmin, and schedule backups all from within the panel. On UnderHost VPS and dedicated services, database performance also depends on allocated CPU, RAM, disk I/O, and how much memory MySQL is allowed to use.
Create a database
- Log in to aaPanel and click Database in the left sidebar
- Click Add Database
- Fill in the details:
- Database name: A unique name (lowercase letters, numbers, underscores)
- Username: A dedicated database user for this database
- Password: A strong password for the database user
- Access permissions: Select Local server (most secure)-only applications on the same server can connect
- Click Submit
Note the database name, username, password, and host (127.0.0.1 or localhost) for use in your application's configuration file.
Access phpMyAdmin
aaPanel includes phpMyAdmin, accessible from the Database section:
- Go to Database
- Find the database in the list
- Click the phpMyAdmin icon or link next to it
phpMyAdmin opens logged in to that database. From here you can browse tables, run SQL queries, import SQL files, and export backups.
If you do not see phpMyAdmin in aaPanel, it may not be installed. Go to aaPanel → App Store, search for phpMyAdmin, and install it.
Import a database
Via phpMyAdmin (under ~100MB):
- Open phpMyAdmin for the target database
- Click the Import tab
- Select the
.sqlor.sql.gzfile and click Go
Via SSH command line (large databases):
mysql -u DB_USER -p DB_NAME < /path/to/backup.sql
For a compressed backup:
gunzip -c backup.sql.gz | mysql -u DB_USER -p DB_NAME
Export a database
Via phpMyAdmin: Select the database → Export tab → Quick method → Go.
Via SSH (recommended for large databases):
mysqldump -u DB_USER -p DB_NAME | gzip > /www/backup/db-$(date +%Y%m%d).sql.gz
Scheduled database backups
aaPanel can schedule automatic database backups:
- Go to Cron Jobs in aaPanel
- Click Add task
- Set the task type to Backup Database
- Select the database, set the backup path, and choose how many backups to retain
- Set the schedule (e.g., daily at 3am)
- Click Add task
Backup files are stored on the server. Download them via FTP or SFTP periodically to keep an off-server copy.
For production sites, combine aaPanel database backups with off-server storage or an UnderHost backup solution. Always test at least one restore before relying on a backup schedule.
Database connection errors
If your application shows "Error establishing a database connection":
- Verify the database name, username, and password in
wp-config.phpor your app's config match exactly what you set in aaPanel - Use
127.0.0.1as the database host (notlocalhost) if you encounter connection refused errors - Check MySQL is running:
systemctl status mysql - Check disk space is not full:
df -h-a full disk stops MySQL - Review MySQL error log:
tail -50 /www/server/data/mysql-error.log - If the issue follows a to UnderHost, compare database name, username, table prefix, and PHP version with the old host
Related: Create website in aaPanel | Install WordPress in aaPanel | cPanel phpMyAdmin | Database connection error
Need aaPanel hosting?
Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.





















