Skip to content

Erro na evolutionAPI com mysql #2344

@diogoosz

Description

@diogoosz

Issue: Evolution API v2.3.6 MySQL Syntax Errors

Hello everyone, I’m looking for some technical support. I attempted to install Evolution API v2.3.6 using MySQL 8.0, but I am encountering SQL syntax errors that appear to be internal conflicts between the API and the database engine.


🛠️ Environment & Steps Taken

I set up the environment via Docker Compose using the official Evolution image, Redis, and MySQL (Percona 8.0). I configured the .env file following the official documentation, setting:

  • DATABASE_PROVIDER=mysql
  • DATABASE_CONNECTION_URI (pointing correctly to the MySQL container).

❌ The Bug

While the API initializes, it crashes during basic operations (saving messages or querying the database) with two primary errors:

1. Syntax Error (PostgreSQL Query on MySQL)

Raw query failed. Code: 1064. > Message: You have an error in your SQL syntax; check the manual... near '"Message" WHERE "instanceId" = ? AND "key"->>'id' = '

  • Observation: The error shows the API is attempting to use double quotes ("Message") and the JSON operator (->>), which are specific to PostgreSQL, despite the provider being explicitly set to MySQL.

2. Schema Error (Missing lid field)

Invalid this.cache.delete() invocation... > Unknown argument lid. Did you mean id?

  • Observation: It seems Prisma did not create the lid column in MySQL, or the caching logic is attempting to access a field that does not exist in the schema generated for this specific database type.

🔍 Debugging Procedures Already Performed

  • Wiped all Docker volumes and rebuilt from scratch.
  • Attempted to force variables: DATABASE_TYPE=mysql and DATABASE_CONNECTION_CLIENT_NAME=mysql.
  • Verified that the database is "ready for connections" before the API service starts.

❓ Questions

  1. Has anyone successfully run v2.3.6 stable with MySQL?
  2. Is there a specific configuration to prevent Prisma from injecting Postgres-specific syntax into raw queries when the provider is MySQL?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions