Docs Navigation
Docs/Database Protocols

MySQL Protocol Guide

Connecting MySQL clients, DML, DDL, CTEs, Window Functions, and UDFs.

Last Updated: August 2026

MySQL Compatibility Overview

KOLMOS implements the MySQL V10 wire protocol (port 3306) with `mysql_native_password` authentication. It seamlessly parses and executes standard MySQL SQL queries via Apache DataFusion.

Supported MySQL SQL & UDFs

sqlKOLMOS Reference
-- 1. Schema Creation & DDL
CREATE TABLE employees (
  id INT PRIMARY KEY,
  name VARCHAR(100),
  department VARCHAR(50),
  salary DECIMAL(10, 2),
  hired_at DATETIME
);

-- 2. CTEs & Window Functions
WITH dept_stats AS (
  SELECT 
    department,
    AVG(salary) AS avg_sal
  FROM employees
  GROUP BY department
)
SELECT 
  e.name,
  e.department,
  e.salary,
  RANK() OVER (PARTITION BY e.department ORDER BY e.salary DESC) AS dept_rank,
  d.avg_sal
FROM employees e
JOIN dept_stats d ON e.department = d.department;

-- 3. MySQL Specific Functions (IF, GROUP_CONCAT, JSON_EXTRACT)
SELECT 
  department,
  GROUP_CONCAT(name ORDER BY name SEPARATOR ', ') AS team_members,
  IF(AVG(salary) > 80000, 'High', 'Standard') AS pay_grade
FROM employees
GROUP BY department;