Aller au contenu principal

Configuration de la Base de Donnees

FeedbackPulse SaaS uses MySQL or MariaDB as its primary database.


✅ Supported Base de Donneess

Base de DonneesVersionStatus
MySQL8.0+✅ Fully supported (recommended)
MariaDB10.6+✅ Fully supported
PostgreSQL15+⚠️ Experimental (migrations may need adjustment)
SQLite3.35+⚠️ Development only (not for production)

🔧 Creating the Base de Donnees

Before running the installer:

-- Connect to MySQL
mysql -u root -p

-- Create database with proper character set
CREATE DATABASE feedbackpulse
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;

-- Create a dedicated user (recommended for security)
CREATE USER 'feedbackpulse'@'localhost'
IDENTIFIED BY 'your_strong_password_here';

-- Grant permissions
GRANT ALL PRIVILEGES ON feedbackpulse.*
TO 'feedbackpulse'@'localhost';

FLUSH PRIVILEGES;
EXIT;

⚠️ Why utf8mb4? It supports the full Unicode character set including emojis. Customer feedback often contains emojis, so this is important!


⚙️ .env Configuration

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=feedbackpulse
DB_USERNAME=feedbackpulse
DB_PASSWORD=your_strong_password_here

Common Gotchas

IssueSolution
SQLSTATE[HY000] [2002] Connection refusedUse 127.0.0.1 instead of localhost
SQLSTATE[HY000] [1045] Access deniedCheck username/password, ensure user has privileges
SQLSTATE[42S01] Table already existsBase de Donnees wasn't empty. Drop and recreate, or use --force flag
Emoji characters showing as ????Base de Donnees charset must be utf8mb4, not utf8

🔍 MySQL Performance Tuning

For production servers with many tenants, optimize MySQL:

# /etc/mysql/mysql.conf.d/mysqld.cnf

[mysqld]
# InnoDB buffer pool (set to 50-70% of available RAM)
innodb_buffer_pool_size = 1G

# Log file size
innodb_log_file_size = 256M

# Max connections (increase for high-traffic platforms)
max_connections = 200

# Query cache (disable in MySQL 8.0+, it's deprecated)
query_cache_type = 0

# Slow query log (for debugging performance issues)
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2

Restart MySQL:

sudo systemctl restart mysql

💾 Backup & Restore

Using the Admin Panel

FeedbackPulse has a built-in backup feature:

  1. Allez a Admin → Sauvegardes
  2. Click Create Backup
  3. Download the .sql.gz file

Manual Backup

mysqldump -u feedbackpulse -p feedbackpulse | gzip > backup_$(date +%Y%m%d_%H%M%S).sql.gz

Restore

gunzip < backup_20240101_120000.sql.gz | mysql -u feedbackpulse -p feedbackpulse

⏭️ Etapes Suivantes