Note: This documentation is still in progress, not reviewed properly, and might contain some errors or outdated images. It's intended for the upcoming 4.0.0 release, so configuration settings might be different from previous versions.
MySQL Configuration for Poweradmin
Overview
This guide explains how to configure Poweradmin to use MySQL or MariaDB as your database backend.
Requirements
- MySQL 5.7+ or MariaDB 10.3+
- PHP with PDO MySQL extension enabled
- MySQL user with appropriate privileges
Configuration Steps
- Create a configuration file at
/config/settings.php
based on the example below:
<?php
/**
* Poweradmin MySQL Configuration
*/
return [
/**
* Database Settings
*/
'database' => [
'type' => 'mysql', // Set database type to MySQL
'host' => 'localhost', // MySQL server hostname
'port' => '3306', // Default MySQL port
'user' => 'poweradmin', // Database username
'password' => 'your_password', // Database password (change this!)
'name' => 'powerdns', // Database name
'charset' => 'utf8mb4', // Recommended: utf8mb4 for full Unicode support
'file' => '', // Not used for MySQL
'debug' => false, // Set to true to see SQL queries for debugging
],
// Other configuration sections remain the same as in settings.defaults.php
];
Database Creation
Creating the Database
CREATE DATABASE powerdns CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER 'poweradmin'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON powerdns.* TO 'poweradmin'@'localhost';
FLUSH PRIVILEGES;
Schema Installation
The SQL schema files are located in the sql/
directory:
- For a new installation: Use
sql/poweradmin-mysql-db-structure.sql
- For PowerDNS schema: Check the appropriate version in
sql/pdns/[version]/schema.mysql.sql
mysql -u poweradmin -p powerdns < sql/poweradmin-mysql-db-structure.sql
mysql -u poweradmin -p powerdns < sql/pdns/[version]/schema.mysql.sql
Troubleshooting
Common Issues
-
Connection errors: Verify the host, port, user and password settings
-
Character set issues: Make sure the charset in settings matches the database charset
-
Permission problems: Ensure the database user has appropriate privileges