Basic Configuration
Database Connection
.env
Database driver to use. Options:
mysql, mariadbBoth drivers work with MySQL and MariaDB. The
mariadb driver enables MariaDB-specific optimizations.Database server hostname or IP address.
Database server port.
Name of the database to use.
Database user with access to the panel database.
Database user password.
Advanced Configuration
Unix Socket Connection
For local databases, Unix sockets provide better performance than TCP:.env
Path to MySQL/MariaDB Unix socket file. When set, this takes precedence over
DB_HOST and DB_PORT.Database URL
Alternatively, use a database URL for configuration:.env
Full database connection URL. Overrides individual connection parameters.
Character Set & Collation
.env
Character set for database connections.
Collation for character comparisons and sorting.
Table Prefix
.env
Prefix for all database tables. Useful when sharing a database with other applications.
Timezone Configuration
.env
MySQL timezone offset. Automatically calculated from
APP_TIMEZONE if not set.The Panel automatically converts
APP_TIMEZONE to a MySQL-compatible offset.Strict Mode
.env
Enable MySQL strict mode for stricter SQL validation.
Currently defaults to
false for compatibility. Future versions may default to true.SSL/TLS Configuration
Secure your database connection with SSL/TLS encryption.Basic SSL
.env
SSL connection mode. Options:
prefer- Use SSL if available, otherwise unencryptedrequire- Require SSL connectionverify-ca- Require SSL and verify CA certificateverify-full- Require SSL and verify certificate identity
Advanced SSL Configuration
For certificate-based authentication:.env
Path to Certificate Authority (CA) certificate file.
Path to client certificate file.
Path to client private key file.
Verify the server’s SSL certificate.
Database Setup
Creating the Database
-
Log into MySQL/MariaDB:
-
Create the database and user:
Running Migrations
After configuring the database connection, run migrations:--seed flag populates the database with default data, and --force is required in production.
Remote Database Configuration
Connecting to Remote MySQL/MariaDB
.env
Firewall Configuration
Ensure your database server allows connections from the Panel server:MySQL User Permissions
For remote connections, create the user with the Panel server’s IP:Performance Optimization
Connection Pooling
Laravel automatically manages connection pooling. No additional configuration needed.Query Optimization
Enable query logging during development to identify slow queries:Testing the Connection
Verify your database connection:Connection Test Script
Troubleshooting
Connection Refused
Connection Refused
Possible causes:
- MySQL/MariaDB service is not running
- Incorrect
DB_HOSTorDB_PORT - Firewall blocking connections
Access Denied for User
Access Denied for User
Possible causes:
- Incorrect username or password
- User doesn’t have permissions for the database
- User host restriction mismatch
SSL Connection Error
SSL Connection Error
Possible causes:
- MySQL not configured for SSL
- Invalid certificate paths
- Certificate verification failures
Character Set Issues
Character Set Issues
Symptoms:
- Emoji or special characters not displaying correctly
- Database errors related to character encoding
Security Best Practices
Strong Passwords
Use randomly generated passwords with at least 32 characters for database users.
Restrict User Access
Grant database users only the permissions they need, and restrict by host.
Use SSL/TLS
Enable SSL/TLS for all database connections, especially for remote databases.
Regular Backups
Implement automated database backups with point-in-time recovery capabilities.
Supported Database Versions
Minimum Requirements:
- MySQL 8.0 or higher
- MariaDB 10.2 or higher
- MySQL 8.0.34+
- MariaDB 10.11+ (LTS)
