---
title: "Discussion on \"OpenAI Agents SDK SQLAlchemySession on MySQL: fixing 'VARCHAR requires a length on dialect mysql'\" | Hashnode"
description: "Discussion on \"OpenAI Agents SDK SQLAlchemySession on MySQL: fixing 'VARCHAR requires a length on dialect mysql'\". Point the Agents SDK's SQLAlchemy session at MySQL or MariaDB with create_tables=True and the first write fails before any table exists. Here's why, and a small schema script that works around it."
url: "https://hashnode.com/posts/openai-agents-sdk-sqlalchemysession-mysql-varchar-requires-a-length/6af889537e986eb17f619bc5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [OpenAI Agents SDK SQLAlchemySession on MySQL: fixing 'VARCHAR requires a length on dialect mysql'](https://memorysync.hashnode.dev/openai-agents-sdk-sqlalchemysession-mysql-varchar-requires-a-length?utm_source=hashnode&utm_medium=feed)

Point the Agents SDK's SQLAlchemy session at MySQL or MariaDB with create\_tables=True and the first write fails before any table exists. Here's why, and a small schema script that works around it.

3h ago · 14 min read · memorysync.hashnode.dev  
Read the article

-   [#openai](https://hashnode.com/tag/openai)
-   [#python](https://hashnode.com/tag/python)
-   [#mysql](https://hashnode.com/tag/mysql)
-   [#ai](https://hashnode.com/tag/ai)
-   [#debugging](https://hashnode.com/tag/debugging)

## Written by

[MemorySync](https://hashnode.com/@memorysync)

@memorysync · San Francisco, USA

  
[View profile](https://hashnode.com/@memorysync)

Building MemorySync (memorysync.io) — persistent memory infrastructure for AI agents, Cursor, and Claude Code.

Building MemorySync (memorysync.io) — persistent memory infrastructure for AI agents, Cursor, and Claude Code.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
