# VillageSQL Server for MySQL - Documentation > Documentation for VillageSQL, a drop-in replacement for MySQL that offers extensions. ## Docs - [Connecting MySQL to AI APIs](https://villagesql.com/docs/guides/ai-api-setup.md): How to connect MySQL to AI APIs using VillageSQL's vsql_ai extension — installing the extension, configuring API keys, and choosing a provider and model. - [Running AI Models from MySQL Queries](https://villagesql.com/docs/guides/ai-prompts-in-mysql.md): How to call AI language models directly from MySQL queries using VillageSQL's ai_prompt() function — enriching rows, classifying data, and batch-processing text. - [AI Summarization in MySQL](https://villagesql.com/docs/guides/ai-summarization.md): How to summarize long text stored in MySQL using VillageSQL's ai_prompt() — generating summaries of support tickets, articles, and documents directly in SQL. - [MySQL Backup Strategies](https://villagesql.com/docs/guides/backup-strategies.md): How to back up MySQL databases: mysqldump for logical backups, MySQL Shell's dump utilities, binary log-based point-in-time recovery, and backup best practices for production systems. - [MySQL Binary Logging](https://villagesql.com/docs/guides/binary-logging.md): How MySQL binary logging works: enabling binary logging, configuring ROW vs. STATEMENT vs. MIXED formats, reading binary log position for point-in-time recovery, setting up replication, and using binary logs for change data capture (CDC). - [Bulk Inserts in MySQL](https://villagesql.com/docs/guides/bulk-inserts.md): How to insert large amounts of data into MySQL efficiently: multi-row INSERT, LOAD DATA INFILE, INSERT...SELECT, disabling keys, and transaction batching for performance. - [MySQL Character Sets and Collations](https://villagesql.com/docs/guides/character-sets.md): How MySQL character sets and collations work: utf8mb4 vs utf8, choosing collations, setting character sets at database and column level, sorting behavior, and fixing charset problems. - [CHECK Constraints in MySQL](https://villagesql.com/docs/guides/check-constraints.md): How MySQL CHECK constraints work: syntax, enforcement behavior, named constraints, disabling constraints, and how CHECK compares to triggers and application-level validation. - [Choosing MySQL Data Types](https://villagesql.com/docs/guides/choosing-data-types.md): How to choose the right MySQL data type for your columns: integers, strings, dates, and JSON — with storage costs and performance trade-offs. - [MySQL Connection Pooling](https://villagesql.com/docs/guides/connection-pooling.md): How MySQL connection pooling works, why persistent connections matter for performance, and how to configure ProxySQL and application-level poolers. - [Covering Indexes in MySQL](https://villagesql.com/docs/guides/covering-indexes.md): What covering indexes are in MySQL, how they eliminate row lookups, and how to design them for your most important queries. - [CTEs in MySQL](https://villagesql.com/docs/guides/ctes-in-mysql.md): How to use Common Table Expressions in MySQL 8.0: WITH clause syntax, multiple CTEs, recursive CTEs for hierarchical data, and CTEs vs subqueries. - [MySQL Date and Time Functions](https://villagesql.com/docs/guides/date-time-functions.md): Reference guide for MySQL date and time functions: NOW, CURDATE, DATE_FORMAT, DATEDIFF, DATE_ADD, EXTRACT, STR_TO_DATE, UNIX_TIMESTAMP, and common date manipulation patterns. - [Deadlocks in MySQL](https://villagesql.com/docs/guides/deadlocks.md): How MySQL deadlocks happen, how InnoDB detects and resolves them, how to read the deadlock log, and patterns for preventing deadlocks in your application. - [Encrypting Columns in MySQL](https://villagesql.com/docs/guides/encrypting-columns.md): How to encrypt sensitive column data in MySQL — why MySQL's AES_ENCRYPT uses an insecure default mode, and how VillageSQL's encrypt() fixes it automatically. - [Foreign Keys in MySQL](https://villagesql.com/docs/guides/foreign-keys.md): How MySQL foreign keys work, how to define them, the CASCADE and RESTRICT options, and the performance trade-offs to understand before using them. - [Full-Text Search in MySQL](https://villagesql.com/docs/guides/full-text-search.md): How MySQL full-text search works: FULLTEXT indexes, MATCH...AGAINST syntax, natural language vs boolean mode vs query expansion, and when to use full-text vs LIKE. - [Generated Columns in MySQL](https://villagesql.com/docs/guides/generated-columns.md): How MySQL generated columns work: VIRTUAL vs STORED, expressions and indexing, functional index patterns, and when generated columns replace application-layer computation. - [GROUP BY and HAVING in MySQL](https://villagesql.com/docs/guides/group-by-having.md): How MySQL GROUP BY and HAVING work: aggregate functions, HAVING vs WHERE, ONLY_FULL_GROUP_BY mode, GROUP BY WITH ROLLUP, and common mistakes. - [Hashing Data in MySQL](https://villagesql.com/docs/guides/hashing-data.md): How to hash data in MySQL for integrity checks, deduplication, and fingerprinting — using SHA-256 and other algorithms via VillageSQL's digest() function. - [HMAC Signatures in MySQL](https://villagesql.com/docs/guides/hmac-mysql.md): How to compute and verify HMAC signatures in MySQL using VillageSQL's hmac() function — for webhook verification, data integrity, and tamper detection. - [Making HTTP Requests from SQL](https://villagesql.com/docs/guides/http-requests-in-mysql.md): How to call external HTTP APIs directly from MySQL queries using VillageSQL's vsql_http extension — GET, POST, and parsing JSON responses. - [Sending Webhooks from Triggers](https://villagesql.com/docs/guides/http-webhooks.md): How to send HTTP webhooks from MySQL triggers using VillageSQL's vsql_http extension — push row changes to external services automatically on INSERT, UPDATE, or DELETE. - [MySQL Guides](https://villagesql.com/docs/guides/index.md): Practical MySQL guides for developers. Covers data modeling, querying, security, performance, AI integration, and day-to-day operations. - [MySQL INFORMATION_SCHEMA](https://villagesql.com/docs/guides/information-schema.md): How to use MySQL's INFORMATION_SCHEMA to query table metadata, find column definitions programmatically, audit database structure, debug schema issues, and replace SHOW commands with filterable SQL queries. - [How InnoDB Stores Data](https://villagesql.com/docs/guides/innodb-storage.md): How MySQL's InnoDB storage engine organizes data on disk: clustered indexes, pages, the buffer pool, and what this means for query performance. - [Geolocation Lookups by IP in MySQL](https://villagesql.com/docs/guides/ip-geolocation.md): How to do IP geolocation lookups in MySQL — importing MaxMind GeoLite2 or an API-based data source, querying IP ranges for country and region, accuracy trade-offs, and using VillageSQL's INET type for unified IPv4/IPv6 lookups with sub-millisecond latency. - [IPv6 Storage in MySQL](https://villagesql.com/docs/guides/ipv6-storage.md): How to store IPv6 addresses in MySQL — VARBINARY(16) with INET6_ATON, and how VillageSQL's INET type handles IPv4 and IPv6 in one unified column. - [MySQL JOINs Explained](https://villagesql.com/docs/guides/joins.md): How MySQL JOIN types work: INNER JOIN, LEFT JOIN, RIGHT JOIN, and CROSS JOIN — with examples, performance considerations, and common mistakes. - [JSON in MySQL](https://villagesql.com/docs/guides/json-in-mysql.md): How to store, query, and index JSON data in MySQL: the JSON column type, path expressions, JSON functions, and how to index JSON fields with generated columns. - [How MySQL Indexes Work](https://villagesql.com/docs/guides/mysql-indexes.md): A practical guide to MySQL indexes: how B-tree indexes work, when MySQL uses them, composite index column order, covering indexes, and common mistakes. - [MySQL on Docker](https://villagesql.com/docs/guides/mysql-on-docker.md): How to run MySQL 8.4 or VillageSQL in Docker — official image setup, persistent named volumes, Docker Compose multi-service configuration, networking between containers, and when Docker is the right deployment choice over native install or managed cloud. - [Normalization in MySQL](https://villagesql.com/docs/guides/normalization.md): How to normalize a MySQL database schema: first, second, and third normal form explained with examples, plus when denormalization makes sense. - [NULL in MySQL](https://villagesql.com/docs/guides/null-in-mysql.md): How NULL works in MySQL: three-valued logic, common pitfalls with comparisons and aggregates, and how indexes handle NULL values. - [Password Hashing in MySQL](https://villagesql.com/docs/guides/password-hashing.md): Why MySQL's built-in hash functions aren't safe for passwords, and how to store password hashes correctly using PBKDF2 with VillageSQL. - [Migrating from PostgreSQL to MySQL](https://villagesql.com/docs/guides/postgres-to-mysql.md): How to migrate a PostgreSQL database to MySQL: schema translation, data type mapping, SQL dialect differences, sequence vs AUTO_INCREMENT, and common migration pitfalls. - [Choosing a Primary Key Strategy in MySQL](https://villagesql.com/docs/guides/primary-key-strategies.md): Compare AUTO_INCREMENT, BINARY(16) UUIDs, and native UUID types in MySQL — when each makes sense and how to avoid the tradeoffs that bite you later. - [Generating Random Data in MySQL](https://villagesql.com/docs/guides/random-data-mysql.md): How to generate random data in MySQL — cryptographically secure bytes, random UUIDs, and test data — using RAND(), RANDOM_BYTES(), and VillageSQL's gen_random_bytes(). - [Reading EXPLAIN in MySQL](https://villagesql.com/docs/guides/reading-explain.md): How to read MySQL EXPLAIN output: what each column means, how to spot full table scans, and how to use EXPLAIN to fix slow queries. - [MySQL Replication Basics](https://villagesql.com/docs/guides/replication-basics.md): How MySQL replication works: source and replica setup, binary log-based replication, GTID replication, replication lag, monitoring with SHOW REPLICA STATUS, and common replication problems. - [Enriching Rows with External API Data](https://villagesql.com/docs/guides/rest-api-enrichment.md): How to pull live data from external REST APIs into MySQL query results using VillageSQL's vsql_http extension. - [Schema Migrations in MySQL](https://villagesql.com/docs/guides/schema-migrations.md): How to run MySQL schema migrations safely: ALTER TABLE behavior, online DDL, large table migrations, and how to use pt-online-schema-change or gh-ost. - [MySQL Security Hardening](https://villagesql.com/docs/guides/security-hardening.md): How to secure a MySQL server: running mysql_secure_installation, removing anonymous users, restricting root access, enforcing password policies, auditing privileges, enabling SSL/TLS, and reducing the attack surface. - [Sentiment Analysis on MySQL Data](https://villagesql.com/docs/guides/sentiment-analysis.md): How to run sentiment analysis on text stored in MySQL using VillageSQL's ai_prompt() — scoring reviews, support tickets, and feedback without leaving SQL. - [The MySQL Slow Query Log](https://villagesql.com/docs/guides/slow-query-log.md): How to enable and use MySQL's slow query log to find queries that need optimization, including log format, key fields, and mysqldumpslow. - [Stored Procedures in MySQL](https://villagesql.com/docs/guides/stored-procedures.md): How MySQL stored procedures work: CREATE PROCEDURE syntax, IN/OUT/INOUT parameters, local variables, control flow, cursors, and when stored procedures help vs hurt. - [Storing IP Addresses in MySQL](https://villagesql.com/docs/guides/storing-ip-addresses.md): How to store IP addresses in MySQL efficiently — why VARCHAR and INT fall short, and how VillageSQL's INET type handles IPv4 and IPv6 in one column. - [Storing MAC Addresses in MySQL](https://villagesql.com/docs/guides/storing-mac-addresses.md): How to store MAC addresses in MySQL — why VARCHAR falls short, and how VillageSQL's MACADDR and MACADDR8 types provide compact storage, format normalization, and OUI extraction. - [MySQL String Functions](https://villagesql.com/docs/guides/string-functions.md): Reference guide for MySQL string functions: CONCAT, SUBSTRING, TRIM, REPLACE, UPPER, LOWER, LENGTH, LIKE, REGEXP, FORMAT, and common string manipulation patterns. - [Querying by Subnet in MySQL](https://villagesql.com/docs/guides/subnet-queries.md): How to query rows by IP subnet in MySQL — bitwise range checks with INET_ATON, and cleaner subnet queries using VillageSQL's INET type and network functions. - [Subqueries vs JOINs in MySQL](https://villagesql.com/docs/guides/subqueries-vs-joins.md): When to use subqueries vs JOINs in MySQL: correlated vs uncorrelated subqueries, EXISTS vs IN, performance differences, and how the MySQL optimizer handles each. - [Symmetric Encryption in MySQL](https://villagesql.com/docs/guides/symmetric-encryption.md): How symmetric encryption works in MySQL — AES key sizes, CBC vs ECB mode, MySQL's AES_ENCRYPT limitations, and when to encrypt in SQL vs the application layer. - [Table Partitioning in MySQL](https://villagesql.com/docs/guides/table-partitioning.md): How MySQL table partitioning works: RANGE, LIST, HASH, and KEY partitioning types, partition pruning, when partitioning improves performance, and common pitfalls. - [Classifying Text in MySQL with AI](https://villagesql.com/docs/guides/text-classification.md): How to classify text in MySQL using VillageSQL's ai_prompt() function — labeling rows by category, intent, or topic without leaving SQL. - [Timestamps and Time Zones in MySQL](https://villagesql.com/docs/guides/timestamps-timezones.md): How MySQL handles DATETIME vs TIMESTAMP, time zone storage and conversion, and how to avoid common bugs when your application spans multiple time zones. - [Transactions in MySQL](https://villagesql.com/docs/guides/transactions.md): How MySQL transactions work: COMMIT, ROLLBACK, isolation levels, and how to use transactions to keep data consistent. - [MySQL Triggers](https://villagesql.com/docs/guides/triggers.md): How MySQL triggers work: CREATE TRIGGER syntax, BEFORE vs AFTER, NEW and OLD row references, multiple triggers per event, and when triggers help vs hurt maintainability. - [Upgrading from MySQL](https://villagesql.com/docs/guides/upgrade.md): Step-by-step guide to upgrading from upstream MySQL to VillageSQL. - [UPSERT in MySQL](https://villagesql.com/docs/guides/upsert.md): How to do UPSERT in MySQL: INSERT ... ON DUPLICATE KEY UPDATE, REPLACE INTO, INSERT IGNORE, when to use each, and the AUTO_INCREMENT side effects to know about. - [MySQL User Management](https://villagesql.com/docs/guides/user-management.md): How to create, modify, and drop MySQL users: CREATE USER syntax, privilege levels, GRANT and REVOKE, roles in MySQL 8.4, and least-privilege best practices. - [UUIDs in MySQL](https://villagesql.com/docs/guides/uuids.md): How to use UUIDs as primary keys in MySQL — storage strategies, performance tradeoffs, and UUID versions explained. - [Generating Vector Embeddings in MySQL](https://villagesql.com/docs/guides/vector-embeddings.md): How to generate and store vector embeddings in MySQL using VillageSQL's ai_embedding() function — for semantic search, similarity matching, and recommendation systems. - [MySQL Views](https://villagesql.com/docs/guides/views.md): How MySQL views work: creating and querying views, updatable views, WITH CHECK OPTION, view algorithms (MERGE vs TEMPTABLE), and when views help vs hurt. - [Window Functions in MySQL 8.4](https://villagesql.com/docs/guides/window-functions.md): How MySQL 8.4 window functions work: ROW_NUMBER, RANK, LAG, LEAD, running totals, and how they differ from GROUP BY aggregates. - [Extension Architecture](https://villagesql.com/docs/mysql-8.4/0.0.3/architecture.md): How VillageSQL's extension system works internally - [Creating Extensions](https://villagesql.com/docs/mysql-8.4/0.0.3/create.md): Learn how to create custom VillageSQL extensions using the extension template and VEF. - [Development](https://villagesql.com/docs/mysql-8.4/0.0.3/development.md): Writing extension functions and running tests for your VillageSQL extension. - [Extension Examples](https://villagesql.com/docs/mysql-8.4/0.0.3/examples.md): Learn from the vsql_complex reference implementation using the VEF SDK - [Extensions or Plugins and Components](https://villagesql.com/docs/mysql-8.4/0.0.3/extensions-or-plugins.md): When to build a VEF extension versus using MySQL's native plugin or component interfaces. - [Introduction](https://villagesql.com/docs/mysql-8.4/0.0.3/index.md): Welcome to VillageSQL Server for MySQL 8.4.8-0.0.3 - [Installing Extensions](https://villagesql.com/docs/mysql-8.4/0.0.3/install.md): How to add new capabilities to VillageSQL using extensions. - [Available Extensions](https://villagesql.com/docs/mysql-8.4/0.0.3/list.md): VillageSQL extensions you can use - [Managing Extensions](https://villagesql.com/docs/mysql-8.4/0.0.3/managing.md): Monitor, troubleshoot, and manage VillageSQL extensions - [Quickstart](https://villagesql.com/docs/mysql-8.4/0.0.3/quickstart.md): Get up and running with VillageSQL Server. - [System Reference](https://villagesql.com/docs/mysql-8.4/0.0.3/reference.md): VillageSQL system views and variables for querying extension metadata and server state - [Clone and Build from Source](https://villagesql.com/docs/mysql-8.4/0.0.3/source.md): Compile VillageSQL Server for MySQL from source code and get started with extensions. - [Uninstalling Extensions](https://villagesql.com/docs/mysql-8.4/0.0.3/uninstall.md): Remove VillageSQL extensions safely - [Version Policy](https://villagesql.com/docs/mysql-8.4/0.0.3/version-policy.md): Understand VillageSQL's versioning scheme and MySQL compatibility matrix. ## Optional - [GitHub](https://github.com/villagesql/villagesql-server) - [Issues](https://github.com/villagesql/villagesql-server/issues) - [Discord](https://discord.gg/KSr6whd3Fr) - [Blog](https://villagesql.com/blog)