You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Mautic数据库架构分析:本地部署后数据存储位置及方式咨询

Hey there! Let's break down Mautic's data storage mechanism since you've got it running locally. I've worked with Mautic's backend a fair bit, so here's what you need to know:

Mautic Data Storage Overview

Mautic is a classic LAMP/LEMP stack application, meaning its core structured data lives in a relational database (mostly MySQL/MariaDB), while unstructured assets and temporary files are stored directly on your local filesystem.

1. Database (DB) Storage Details

1.1 Database Schema Structure

Mautic uses Doctrine ORM to manage its database, so the schema is defined via PHP entity classes—but once installed locally, you can inspect the actual tables directly in your database. Here are the most critical tables tied to user-entered data:

  • leads: Stores core contact/lead data (names, emails, phone numbers, default fields)
  • lead_fields: Defines custom contact fields you create in the Mautic backend
  • lead_field_values: Stores values for custom contact fields (links to leads and lead_fields tables)
  • assets: Metadata for uploaded files (images, PDFs, docs) — the actual file lives on your filesystem
  • emails: Email templates, draft emails, and send logs
  • campaigns: Configuration data for your marketing campaigns
  • lead_visits: Tracks visitor behavior on your tracked pages

To inspect the schema locally, you can use tools like phpMyAdmin, or run these MySQL commands in your terminal:

# Log into your MySQL server (replace placeholders with your credentials)
mysql -u your_db_username -p your_mautic_db_name

# List all Mautic tables
SHOW TABLES;

# View the structure of a specific table (e.g., the leads table)
DESCRIBE leads;

1.2 Database File Location

If you're using a local MySQL/MariaDB instance, the physical database files are stored in these default paths:

  • Linux: /var/lib/mysql/your_mautic_db_name/ (each table has corresponding .frm and .ibd files for InnoDB engine)
  • Windows: C:\ProgramData\MySQL\MySQL Server X.X\Data\your_mautic_db_name\
  • macOS (Homebrew-installed MySQL): /usr/local/var/mysql/your_mautic_db_name/

2. Local Filesystem Storage

Mautic stores non-structured data directly in its installation directory. Key paths to note:

  • media/files/: Stores all uploaded assets (images, PDFs, documents) — each file maps to a record in the assets database table
  • media/images/: Hosts images used in emails, landing pages, and system-generated assets like QR codes
  • media/cache/: Temporary cache files (compiled templates, image thumbnails, etc.) — safe to delete if you need to clear cache
  • app/config/local.php: Contains your database connection credentials (username, password, database name) — you can verify which database Mautic is connected to here

3. Data Flow Example: When You Enter a Contact

Let’s walk through what happens when you add a new contact in Mautic:

  1. You submit the contact form in the Mautic backend
  2. Mautic uses Doctrine ORM to write the default field data (name, email) to the leads table
  3. If you used custom fields, their values are stored in the lead_field_values table, linked to the contact’s ID in leads
  4. If you upload an avatar for the contact, the image file is saved to media/files/, and its metadata (file path, size) is added to the assets table, with a link back to the contact’s leads record

内容的提问来源于stack exchange,提问作者greeshma y

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.27 03:38:11