Tag Archives: mysql

2025 Rewind and Thank You

I’m grateful to all my professional and personal networks for this year. It has been full of tears, sweat, and blood all over my face once again. Let’s not worry about that. I want to start with a big Thank You to all of you who made this year possible.

If I look back at what stood out in 2025, just before we hit 2026.

Oracle ACE Pro 

I was thrilled to be nominated to the Oracle ACE Program as an ACE Pro in April. This recognition opened doors to launch a technical blog series on vector search and AI integration with MySQL.

Project Antalya at Altinity, Inc. 

We announced native Iceberg catalog and Parquet support on S3 for ClickHouse. This pushes the boundaries of what’s possible with open lakehouse analytics.

MySQL MCP Server 

Introduced a lightweight, secure MySQL MCP server bridging relational databases and LLMs. Practical AI integration starts with safety and observability.

FOSDEM & MySQL’s 30th Birthday 

I have one of my busiest agendas in ten years. It includes the MySQL Devroom Committee, a talk, and an O’Reilly book signing for #mysqlcookbook4e. Additionally, there are 6 talks from Altinity.

O’Reilly Recognition 

After 50+ hours of flights for conferences, I came home to O’Reilly’s all-time recognition for the MySQL Cookbook. It was a moment I won’t forget.

Sailing While Working 

Once again, months at sea with salt, humidity, and wind were challenging. We handled tickets, RCAs, and meetings. We even recorded a podcast on ferry maneuvering. Born to sail, forced to work, making it work anyway.

I am immensely grateful to the #MySQL, #ClickHouse, and #opensource communities. Thank you to my co-authors Sveta Smirnova and Ibrar Ahmed. I also thank my nominator, Vinicius Grippa. I appreciate the Altinity team and every conference organizer who gave me a stage this year.

Recognition is an invitation to contribute more, not a finish line. Looking forward to more open-source collaboration in 2026.

If you’re passionate about open-source databases, MySQL, ClickHouse, or AI integration, or just want to connect, reach out.

#opensource #mysql #clickhouse #oracleacepro #ai #vectorsearch #sailing #LinkedInRewind #Coauthor #2025wrapped

Introducing Lightweight MySQL MCP Server: Secure AI Database Access


A lightweight, secure, and extensible MCP (Model Context Protocol) server for MySQL designed to bridge the gap between relational databases and large language models (LLMs).

I’m releasing a new open-source project: mysql-mcp-server, a lightweight server that connects MySQL to AI tools via the Model Context Protocol (MCP). It’s designed to make MySQL safely accessible to language models, structured, read-only, and fully auditable.

This project started out of a practical need: as LLMs become part of everyday development workflows, there’s growing interest in using them to explore database schemas, write queries, or inspect real data. But exposing production databases directly to AI tools is a risk, especially without guardrails.

mysql-mcp-server offers a simple, secure solution. It provides a minimal but powerful MCP server that speaks directly to MySQL, while enforcing safety, observability, and structure.

What it does

mysql-mcp-server allows tools that speak MC, such as Claude Desktop, to interact with MySQL in a controlled, read-only environment. It currently supports:

  • Listing databases, tables, and columns
  • Describing table schemas
  • Running parameterized SELECT queries with row limits
  • Introspecting indexes, views, triggers (optional tools)
  • Handling multiple connections through DSNs
  • Optional vector search support if using MyVector
  • Running as either a local MCP-compatible binary or a remote REST API server

By default, it rejects any unsafe operations such as INSERT, UPDATE, or DROP. The goal is to make the server safe enough to be used locally or in shared environments without unintended side effects.

Why this matters

As more developers, analysts, and teams adopt LLMs for querying and documentation, there’s a gap between conversational interfaces and real database systems. Model Context Protocol helps bridge that gap by defining a set of safe, predictable tools that LLMs can use.

mysql-mcp-server brings that model to MySQL in a way that respects production safety while enabling exploration, inspection, and prototyping. It’s helpful in local development, devops workflows, support diagnostics, and even hybrid RAG scenarios when paired with a vector index.

Getting started

You can run it with Docker:

docker run -e MYSQL_DSN='user:pass@tcp(mysql-host:3306)/' \
  -p 7788:7788 ghcr.io/askdba/mysql-mcp-server:latest

Or install via Homebrew:

brew install askdba/tap/mysql-mcp-server
mysql-mcp-server

Once running, you can connect any MCP-compatible client (like Claude Desktop) to the server and begin issuing structured queries.

Use cases

  • Developers inspecting unfamiliar databases during onboarding
  • Data teams writing and validating SQL queries with AI assistance
  • Local RAG applications using MySQL and vector search with MyVector
  • Support and SRE teams need read-only access for troubleshooting

Roadmap and contributions

This is an early release and still evolving. Planned additions include:

  • More granular introspection tools (e.g., constraints, stored procedures)
  • Connection pooling and config profiles
  • Structured logging and tracing
  • More examples for integrating with LLM environments

If you’re working on anything related to MySQL, open-source AI tooling, or database accessibility, I’d be glad to collaborate.

Learn more

If you have feedback, ideas, or want to contribute, the project is open and active. Pull requests, bug reports, and discussions are all welcome.

Scoped Vector Search with the MyVector Plugin for MySQL – Part II

Subtitle: Schema design, embedding workflows, hybrid search, and performance tradeoffs explained.



Quick Recap from Part 1

In Part 1, we introduced the MyVector plugin — a native extension that brings vector embeddings and HNSW-based approximate nearest neighbor (ANN) search into MySQL. We covered how MyVector supports scoped queries (e.g., WHERE user_id = X) to ensure that semantic search remains relevant, performant, and secure in real-world multi-tenant applications.

Now in Part 2, we move from concept to implementation:

  • How to store and index embeddings
  • How to design embedding workflows
  • How hybrid (vector + keyword) search works
  • How HNSW compares to brute-force search
  • How to tune for performance at scale

1. Schema Design for Vector Search

The first step is designing tables that support both structured and semantic data.

A typical schema looks like:

CREATE TABLE documents (
    id BIGINT PRIMARY KEY,
    user_id INT NOT NULL,
    title TEXT,
    body TEXT,
    embedding VECTOR(384),
    INDEX(embedding) VECTOR
);

Design tips:

  • Use VECTOR(n) to store dense embeddings (e.g., 384-dim for MiniLM).
  • Always combine vector queries with SQL filtering (WHERE user_id = …, category = …) to scope the search space.
  • Use TEXT or JSON fields for hybrid or metadata-driven filtering.
  • Consider separating raw text from embedding storage for cleaner pipelines.

2. Embedding Pipelines: Where and When to Embed

MyVector doesn’t generate embeddings — it stores and indexes them. You’ll need to decide how embeddings are generated and updated:

a. Offline (batch) embedding

  • Run scheduled jobs (e.g., nightly) to embed new rows.
  • Suitable for static content (documents, articles).
  • Can be run using Python + HuggingFace, OpenAI, etc.
# Python example
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("all-MiniLM-L6-v2")
vectors = model.encode(["Your text goes here"])

b. Write-time embedding

  • Embed text when inserted via your application.
  • Ensures embeddings are available immediately.
  • Good for chat apps, support tickets, and notes.

c. Query-time embedding

  • Used for user search input only.
  • Transforms search terms into vectors (not stored).
  • Passed into queries like:
ORDER BY L2_DISTANCE(embedding, '[query_vector]') ASC

3. Hybrid Search: Combine Text and Semantics

Most real-world search stacks benefit from combining keyword and vector search. MyVector enables this inside a single query:

SELECT id, title
FROM documents
WHERE MATCH(title, body) AGAINST('project deadline')
  AND user_id = 42
ORDER BY L2_DISTANCE(embedding, EMBED('deadline next week')) ASC
LIMIT 5;

This lets you:

  • Narrow results using lexical filters
  • Re-rank them semantically
  • All in MySQL — no sync to external vector DBs

This hybrid model is ideal for support systems, chatbots, documentation search, and QA systems.


4. Brute-Force vs. HNSW Indexing in MyVector

When it comes to similarity search, how you search impacts how fast you scale.

Brute-force search

  • Compares the query against every row
  • Guarantees exact results (100% recall)
  • Simple but slow for >10K rows
SELECT id
FROM documents
ORDER BY COSINE_DISTANCE(embedding, '[query_vector]') ASC
LIMIT 5;

HNSW: Hierarchical Navigable Small World

  • Graph-based ANN algorithm used by MyVector
  • Fast and memory-efficient
  • High recall (~90–99%) with tunable parameters (ef_search, M)
CREATE INDEX idx_vec ON documents(embedding) VECTOR
  COMMENT='{"HNSW_M": 32, "HNSW_EF_CONSTRUCTION": 200}';

Comparison

FeatureBrute ForceHNSW (MyVector)
Recall✅ 100%🔁 ~90–99%
Latency (1M rows)❌ 100–800ms+✅ ~5–20ms
Indexing❌ None✅ Required
Filtering Support✅ Yes✅ Yes
Ideal Use CaseSmall datasetsProduction search

5. Scoped Search as a Security Boundary

Because MyVector supports native SQL filtering, you can enforce access boundaries without separate vector security layers.

Patterns:

  • WHERE user_id = ? → personal search
  • WHERE org_id = ? → tenant isolation
  • Use views or stored procedures to enforce access policies

You don’t need to bolt access control onto your search engine — MySQL already knows your users.


6. HNSW Tuning for Performance

MyVector lets you tune index behavior at build or runtime:

ParamPurposeEffect
MGraph connectivityHigher = more accuracy + RAM
ef_searchTraversal breadth during queriesHigher = better recall, more latency
ef_constructionIndex quality at build timeAffects accuracy and build cost

Example:

ALTER INDEX idx_vec SET HNSW_M = 32, HNSW_EF_SEARCH = 100;

You can also control ef_search per session or per query soon (planned feature).


TL;DR: Production Patterns with MyVector

  • Use VECTOR(n) columns and HNSW indexing for fast ANN search
  • Embed externally using HuggingFace, OpenAI, Cohere, etc.
  • Combine text filtering + vector ranking for hybrid search
  • Use SQL filtering to scope vector search for performance and privacy
  • Tune ef_search and M to control latency vs. accuracy

Coming Up in Part 3

In Part 3, we’ll explore real-world implementations:

  • Semantic search
  • Real-time document recall
  • Chat message memory + re-ranking
  • Integrating MyVector into RAG and AI workflows

We’ll also show query plans and explain fallbacks when HNSW is disabled or brute-force is needed.


Scoped Vector Search with the MyVector Plugin for MySQL – Part I


Semantic Search with SQL Simplicity and Operational Control

Introduction

Vector search is redefining how we work with unstructured and semantic data. Until recently, integrating it into traditional relational databases like MySQL required external services, extra infrastructure, or awkward workarounds. That changes with the MyVector plugin — a native vector indexing and search extension purpose-built for MySQL.

Whether you’re enhancing search for user-generated content, improving recommendation systems, or building AI-driven assistants, MyVector makes it possible to store, index, and search vector embeddings directly inside MySQL — with full support for SQL syntax, indexing, and filtering.

What Is MyVector?

The MyVector plugin adds native support for vector data types and approximate nearest neighbor (ANN) indexes in MySQL. It allows you to:

  • Define VECTOR(n) columns to store dense embeddings (e.g., 384-dim from BERT)
  • Index them using INDEX(column) VECTOR, which builds an HNSW-based structure
  • Run fast semantic queries using distance functions like L2_DISTANCE, COSINE_DISTANCE, and INNER_PRODUCT
  • Use full SQL syntax to filter, join, and paginate vector results alongside traditional columns

By leveraging HNSW, MyVector delivers millisecond-level ANN queries even with millions of rows — all from within MySQL.


Most importantly, it integrates directly into your existing MySQL setup—there is no new stack, no sync jobs, and no third-party dependencies.


Scoped Vector Search: The Real-World Requirement

In most production applications, you rarely want to search across all data. You need to scope vector comparisons to a subset — a single user’s data, a tenant’s records, or a relevant tag.

MyVector makes this easy by combining vector operations with standard SQL filters.

Under the Hood: HNSW and Query Performance

MyVector uses the HNSW algorithm for vector indexing. HNSW constructs a multi-layered proximity graph that enables extremely fast approximate nearest neighbor search with high recall. Key properties:

  • Logarithmic traversal through layers reduces search time
  • Dynamic index support: you can insert/update/delete vectors and reindex as needed
  • Configurable parameters like M and ef_search allow tuning for performance vs. accuracy

Under the Hood: HNSW and Query Performance

MyVector uses the HNSW algorithm for vector indexing. HNSW constructs a multi-layered proximity graph that enables extremely fast approximate nearest neighbor search with high recall. Key properties:

  • Fast ANN queries without external services
  • Scoped filtering before vector comparison
  • Logarithmic traversal through layers reduces search time
  • Dynamic index support: you can insert/update/delete vectors and reindex as needed
  • Configurable parameters like M and ef_search allow tuning for performance vs. accuracy

What’s Next

This post introduces the foundational concept of scoped vector search using MyVector and HNSW. In Part II, we’ll walk through practical schema design patterns, embedding workflows, and hybrid search strategies that combine traditional full-text matching with deep semantic understanding — using nothing but SQL.

My Journey with MySQL Community and Beyond – MySQL Rockstar 2023

After the most memorable MySQL community event, #MySQLBelgianDays2024, and earning legendary recognition from the MySQL Community team, I have decided to share some thoughts about the importance of a community. 

Previously in life

As a former enterprise DBA, I have been part of other communities strictly focused on monetary and entitlement of accomplishments. I had a chance to work on world-leading enterprises and had ability access to the most advanced technologies for both software and hardware. This journey was fun, fruitful, and rewarding for me.

In the latter half of my career, I entered the open-source community of MySQL by shifting my prior decade and a half of experience into it. 

Entry to the open-source community

When I entered this community full-time, there were several controversial discussions and assumptions about Oracle’s acquisition of MySQL, the separation of MariaDB, etc. While some of those claims had some reality, most turned out to be baseless without knowing the intentions and future. 

The importance of Percona Live events and the Oracle MySQL team’s contributions to this community, which several other open-source contributors surrounded, was my entry point. There was a significant influence from hyper-scalers, known as initially social media companies, followed by SAAS and cloud vendors.  

I have watched, followed, and strictly learned from community leaders, including influencers like Peter Zaitsev. Although open-source communities feel and look like closed-circuit groups of geeks having fun, they are very open to newcomers. But remember, communities accept contributors, not watchers. What I mean by contributors is not just coming to a company-paid trip to the event once in a blue moon. Even if you attend an event as a visitor, you can still help by promoting and getting the word out through social media and other networks. 

Where to start?

One can share ideas, code tools, and software and become a speaker. If you aren’t the type of person who can speak and present, you can help others by providing content and ideas and having them review them. Let me help you get there and recognitions will follow.

How do I start helping and becoming a part of the community?

  1. Create a public repository of the tools and code you spend time on. 
  2. Start writing blogs about your experiences and sharing content. 
  3. Become a speaker or co-speaker with the same or similar subject.
  4. Conduct webinars and post-speaking events for those who were not able to attend. Include feedback and corrections to your talk. 
  5. Create training content on recorded videos and training sites. 
  6. Coordinate or help with local meetups. 
  7. Help sponsoring events. 
  8. Encourage to send co-workers to events. 
  9. Introduce newcomers to community veterans. 
  10. Author or co-author books and booklets. 
  11. Act as an event committee member. 
  12. Help to answer questions via GitHub issues or Slack channels. 
  13. Always spread the word through social channels.

If you still can’t do any of those, help marketing colleagues carry boxes of swag and give away materials, and set up and clean up booths for the events. You can always help sales and pre-sales folks by connecting your network. 

I have to credit Laine Campbell for introducing me to and allowing me to meet the most influential leaders of the MySQL community. 

Many thanks to Peter Zaitsev for all the help, support, and openness in accepting me into the MySQL community. 

I would also like to thank the past, current, and future MySQL Community team for their hard work.  The rest of the list is too long to mention here, but they know who they are.

Congratulations to all previous MySQL Rockstars and 2023 winners.