❄️ Winter Sale: 40% OFF AIWU
WINTER_SECRET
Valid until Mar 1st
How to Connect MySQL Database in AIWU - AIWU – AI Plugin for WordPress
Table of Contents
< All Topics

How to Connect MySQL Database in AIWU

Introduction

AIWU allows you to connect to MySQL databases and execute SQL queries directly from your workflows. You can connect to your current WordPress database or any external MySQL database.

This integration enables powerful automation scenarios:

  • Query customer data for personalized campaigns
  • Sync data between WordPress and external systems
  • Generate reports from database records
  • Automate data cleanup and maintenance tasks

What you will learn:

  • How to set up MySQL integration in AIWU
  • How to connect to WordPress database or external MySQL server
  • How to configure connection settings

Step-by-Step Guide

Step 1: Open Integrations Tab

  1. Go to AIWU – Workflows in your WordPress admin panel
  2. Click on the Integrations tab
AIWU Workflows page with Integrations tab highlighted

Step 2: Find MySQL Integration

  1. Scroll down to find Mysql in the integrations list
  2. Click Connect New button
AIWU Integrations list showing MySQL integration with Connect New button

Step 3: Configure Connection Settings

MySQL Integration configuration dialog with connection type host port database username and password fields

Profile Name

Internal name to identify this connection. Use a descriptive name like:

  • Production DB
  • CRM Database
  • Analytics Server

Connection Type

Choose how to connect to the database:

WordPress Database (current) – Uses your existing WordPress database connection. No additional credentials needed.

Custom MySQL Database – Connect to any external MySQL server with custom credentials.

When to use WordPress Database:

  • Query WordPress tables (users, posts, options)
  • Work with WooCommerce data
  • Access plugin data stored in WordPress DB

When to use Custom MySQL Database:

  • Connect to external CRM or ERP systems
  • Access legacy databases
  • Query data from other applications

Custom MySQL Database Settings

If you selected Custom MySQL Database, fill in these fields:

Database Host – Server address. Example: localhost or db.example.com

Port – MySQL port, default is 3306

Database – Database name. Example: my_database

Username – MySQL user. Example: db_user

Password – MySQL password

Timeout, sec – Connection timeout. Default is 10

Step 4: Save and Test Connection

  1. Click Save to save the configuration
  2. The system will automatically test the connection
  3. If successful, you will see Connected status
MySQL integration showing Connected status with Test Edit and Delete options

Managing Connections

After saving, you can manage your MySQL connections:

Test – Verify the connection is working

Edit – Modify connection settings

Delete – Remove the connection

You can create multiple MySQL connections for different databases and select the appropriate one in your workflows.

Security Best Practices

Use dedicated database user

Create a MySQL user with only the permissions needed for your workflows. Grant only SELECT, INSERT, UPDATE, or DELETE as required.

Avoid root credentials

Never use root or admin database credentials in your integrations.

Limit network access

If using external database, ensure your server IP is whitelisted in the database firewall.

Use strong passwords

Generate complex passwords for database users.

Enable SSL

For remote connections, use SSL-encrypted connections when possible.

List item
List item
List item

Troubleshooting

Connection Failed

Possible causes:

  • Incorrect host, port, or credentials
  • Database server is not accessible from your WordPress server
  • Firewall blocking the connection
  • MySQL user lacks permission to connect from your server IP

Solutions:

  1. Verify credentials are correct
  2. Check if database server allows remote connections
  3. Whitelist your WordPress server IP in database firewall
  4. Grant MySQL user access from your server IP

Timeout Errors

Solutions:

  • Increase timeout value in connection settings
  • Check network latency between servers
  • Verify database server is not overloaded
Scroll to Top