Data Data Partnerships Data Value Estimator Referrals Design Search Lead generation Data guides Blog Get an offer →
Theme
← Company data sourcesData source · Databases and warehouses

How to find and export your MySQL data for AI training

MySQL shows how much data you have in the information_schema.TABLES view, which any account with SELECT on your application schemas can query, and the full history is exported with mysqldump or, for large databases, the MySQL Shell dump utilities. Add DATA_LENGTH and INDEX_LENGTH across your application schemas and report the total in GB; the figure covers allocated pages, so it is larger than the dump file. Below, you'll find what MySQL data is and why AI labs and data vendors buy it, the query that reads your size, what to know before you apply, every export step, and what stays private.

Where the total is
information_schema.TABLES: DATA_LENGTH + INDEX_LENGTH
Who can run it
Any account with SELECT on the application schemas
Row counts
TABLE_ROWS can be off 40 to 50%; use COUNT(*)
Stats cache
24 hours; set information_schema_stats_expiry = 0

Key takeaways

  • MySQL shows table sizes in information_schema.TABLES; a developer adds DATA_LENGTH and INDEX_LENGTH across the application schemas and reports the total in GB.
  • TABLE_ROWS is only an estimate for InnoDB tables and the statistics are cached for 24 hours, so use SELECT COUNT(*) for exact counts and set information_schema_stats_expiry to 0 for fresh sizes.
  • mysqldump --single-transaction writes an SQL dump without locking InnoDB tables, and MySQL Shell's util.dumpInstance and util.dumpSchemas dump large databases in parallel with compression.
  • You don't need to export anything to apply: have your size in GB, years of history and account count ready, and the data vendor anonymizes the records before any AI lab sees them.

01

What is MySQL data, and why do AI labs and data vendors buy it?

The short answer

MySQL data is the set of tables that a company's website or software keeps in a MySQL database: signups, orders, invoices, support events and the customers they belong to. AI labs (companies that build and train AI models) and data vendors (companies that anonymize business records and package them for those labs) buy a copy because the tables are tied together by keys and timestamps, which shows real operations in the order they happened.

What a MySQL database records

MySQL is a free, widely used database system, the software that stores a company's records and answers questions about them. A MySQL server holds one or more schemas (MySQL's word for a database), and each schema holds tables, which are grids where every row is one record, such as one invoice, and every column is one fact about it, such as the amount.

MySQL sits behind a large share of websites and online software, so its tables often contain a company's full transaction history. A row in an invoices table points to the customer row it belongs to by a number called a key, and every row carries the time it was created.

Why a linked transaction history teaches an AI model something

An AI model learns by studying a very large number of examples and finding the patterns in them, and those examples are called training data. A table of invoices tied to customers and support events shows what happened, in what order and with what result. Text from the public internet rarely contains records of that kind.

AI labs now want to train AI agents, software that carries out a job step by step, and an agent learns a job from records of that job being done. A data vendor can turn anonymized histories into worked examples, or into a practice copy of a business process in which an agent is scored on each attempt. The full mechanism is in AI training data: why AI companies want your company's data.

How MySQL fits into a dataset

A MySQL database is usually one of several sources in a company's dataset, next to email, documents and tickets. Companies are paid $100K to $2M or more per dataset, according to micro1, the data vendor we typically refer companies to. The price covers the whole dataset, not each source on its own, and what your data is worth explains what moves it.

02

Where does MySQL show how much data you have?

The short answer

MySQL keeps table sizes in a built-in view called information_schema.TABLES, which your developer or database administrator (the person who looks after the database) queries with any SQL client. Adding DATA_LENGTH and INDEX_LENGTH across your application schemas gives the total, and you report it in gigabytes (GB). It works on any MySQL edition, with no special plan.

How to read your database size

The steps below are run by a developer or database administrator in the mysql command-line client or any SQL tool. They rely on the columns documented in the MySQL 8.4 manual page for the TABLES view.

  1. Connect with an account that has SELECT access to every application schema, so that no table is missed.
  2. Run this query. It adds the data and index sizes of each schema, converts bytes to GB by dividing by 1024 three times, and skips MySQL's own system schemas:
    SELECT table_schema,
           ROUND(SUM(data_length + index_length) / POW(1024,3), 2) AS size_gb,
           SUM(table_rows) AS approx_rows
    FROM information_schema.TABLES
    WHERE table_schema NOT IN ('mysql','information_schema','performance_schema','sys')
    GROUP BY table_schema
    ORDER BY size_gb DESC;
  3. Ask for fresh numbers if the data changed recently. MySQL caches these statistics for 24 hours by default. Running SET SESSION information_schema_stats_expiry = 0; before the query turns the cache off for your session, and ANALYZE TABLE on your largest tables refreshes their figures.
  4. Count rows exactly where it matters. For InnoDB tables (MySQL's standard table type), TABLE_ROWS is an estimate that can be off by 40 to 50 percent, so run SELECT COUNT(*) on your main tables.
  5. Find the earliest created date in your core tables, such as the oldest row of an orders table, to learn how many years of history you hold.

What the size columns mean

The TABLES view reports sizes in bytes, and each column describes a different part of a table.

What the MySQL information_schema.TABLES columns report
ColumnWhat it reports
DATA_LENGTHThe space allocated to the table's rows. For InnoDB, that is the pages used by the clustered index, the structure that holds the rows.
INDEX_LENGTHThe space allocated to the other indexes, the lookup structures that make searches fast.
TABLE_ROWSAn approximate row count for InnoDB, exact only for some other storage engines.

Why the size and the row count are estimates

These figures describe allocated pages, which are larger than the raw rows, and they come from cached statistics. The size to report is the sum of DATA_LENGTH and INDEX_LENGTH for the schemas you plan to share, and the row counts are a guide to scale, not an audit.

03

What should you know about your MySQL data before you apply?

The short answer

Have three facts ready: the size of your application schemas in GB, how many years of records they hold and how many people or accounts the database serves. They go into the data manifest, the written summary of which sources hold your records, how many years each covers and roughly how much. You don't need to run an export to find them.

The size in GB

Write down the summed DATA_LENGTH plus INDEX_LENGTH in GB from the query above. Because InnoDB reports allocated pages, the number comes out larger than the raw rows and larger than a dump file. Count the primary server only, not replicas and not binary logs (the running record of changes MySQL keeps for recovery and replication).

The years of history

The years of history come from the earliest created timestamp in your core tables. A SELECT MIN(created_at) on a main table, with the table's own date column, gives the date.

The number of seats

For a database, the seat count is the number of application users or customer accounts that the records describe, taken from a users or accounts table. MySQL's own logins are not seats.

What you don't need to do first

You don't need to export anything to apply, and you don't need to clean or scrub the database. The data vendor anonymizes the records before anyone else sees them, and nothing moves until a lawyer-reviewed license is signed. The application, the intro call and each later step are laid out in how to sell your company's data.

04

How do you export your full MySQL history?

The short answer

A developer or database administrator runs mysqldump --single-transaction --routines --triggers --events --databases app_db, preferably against a replica, to write the database as an SQL file. For large databases, MySQL recommends its MySQL Shell dump utilities instead, util.dumpInstance and util.dumpSchemas, which run in parallel and compress the output.

Run the dump against a replica

A replica is a second MySQL server that keeps a live copy of the first. Dumping from a replica, where you have one, keeps the reading work off the server your business depends on.

The steps with mysqldump

mysqldump ships with MySQL and is described in the MySQL 8.4 reference. The person running it needs an account with SELECT on the dumped tables, SHOW VIEW for views and TRIGGER for triggers.

  1. Take a consistent dump of an InnoDB database without locking its tables, including its stored routines, triggers and scheduled events:
    mysqldump --single-transaction --routines --triggers --events --databases app_db > app_db.sql
    Change app_db to the name of your schema, and list several names after --databases to dump more than one.
  2. Keep the file for the transfer. It contains SQL statements, so reading it back replays every row, which is slow for a large database.

The steps with MySQL Shell, for large databases

MySQL Shell is a separate command-line program, and its dump utilities are described in the MySQL Shell 8.4 manual. The account needs the EVENT, RELOAD, SELECT, SHOW VIEW and TRIGGER privileges, and the output folder must be empty or not yet exist.

  1. Open MySQL Shell and connect to the server.
  2. To dump the whole instance, run:
    util.dumpInstance('/backup/full-dump')
  3. To dump chosen schemas only, run:
    util.dumpSchemas(['app_db'], '/backup/app-dump')

How the two tools compare

Both tools copy the same records, and they differ in speed, format and how well they handle size.

mysqldump compared with the MySQL Shell dump utilities
 mysqldumpMySQL Shell utilities
OutputSQL statements, or delimited text with --tabTab-separated chunks compressed with zstd, plus files describing the structure
Speed on large dataSlow; restoring replays every rowRuns in parallel, 4 threads by default
Consistent without lockingWith --single-transaction, for InnoDB tables onlyGuaranteed for InnoDB tables only
Without that optionNeeds the LOCK TABLES privilegeLocks the instance briefly for a backup

What a dump includes and leaves out

A dump holds the rows, the definitions of the indexes, and the routines, triggers and events you asked for. It does not hold the index contents, binary logs or replicas, so its file is smaller than the size you measured. Tables that use a storage engine other than InnoDB are not covered by the consistency guarantee, which matters if your schema still has older MyISAM tables.

information_schema SIZE The same server, measured Row dataCounted IndexesCounted in full Routines, triggers, eventsNot counted Binary logs and replicasNot counted User accounts (mysql)Excluded by query Allocated pages, so it reads larger. A mysqldump FILE The same server, exported Row dataAs SQL text IndexesDefinitions only Routines, triggers, eventsIncluded by flags Binary logs and replicasNot included User accounts (mysql)Not included Name only the databases you license.
The same server measured two ways. The size from information_schema counts allocated pages, while the dump holds rows as text and index definitions, so the file is smaller.

How long an export takes

MySQL gives no time estimate, and its own manual warns that mysqldump is not meant as a fast or scalable way to back up large amounts of data. Parallel dumps from MySQL Shell finish sooner on a big database, so start early and prefer a replica.

Sources: MySQL documentation, The INFORMATION_SCHEMA TABLES table, mysqldump and MySQL Shell instance and schema dump utilities. Steps checked against these pages in November 2026.

05

What stays private when MySQL data is licensed?

The short answer

The company decides which databases leave MySQL, and the data vendor replaces names and other personal details with consistent stand-ins before an AI lab sees anything. The company keeps ownership of its database, and the license covers defined records for a defined use.

You choose what is in scope

A dump covers only the application databases you name, so the mysql system schema, which holds user accounts, and any tables of payment details stay out of the export. The data vendor also deletes records too sensitive to clean safely instead of anonymizing them.

Names are replaced before a lab sees them

Anonymization means replacing every detail that identifies a person or a company, such as a name or an email address, with a stand-in that is the same every time it appears. The rows still link to each other and the dates still run in order, so a lab can learn from them, but they no longer say who anyone is. The diagram shows one invoice before and after.

IN THE DATABASE invoices joined to accounts invoice 5521 due 2026-02-10 account: Acme Corp billing contact: Dana Brooks phone: 555-0142 status: paid 2026-02-14 rep: Mike Alvarez Real company, contact, phone and rep. WHAT AN AI LAB RECEIVES invoices joined to accounts invoice 5521 due 2026-02-10 account: Client 7 billing contact: Contact 203 phone: 555-0100 status: paid 2026-02-14 rep: Employee 22 Same invoice; the timeline still reads.
The same invoice in both panels. The company, the contact, the phone number and the sales representative are replaced with stand-ins, while the due date, the payment date and the status stay in order.

The method, including what is deleted outright and how you review samples, is in how company data is anonymized for AI training.

Ownership and payment

Licensing gives the buyer limited rights to a copy, while the company keeps ownership of the originals. The terms that matter, such as exclusivity, permitted use and deletion, are covered in data licensing. micro1 pays in full within 30 days of accepting the data, usually as a single payment.

Questions

Frequently asked questions

Why does information_schema show a different size than my mysqldump file?

The two count different things. DATA_LENGTH and INDEX_LENGTH measure the pages MySQL has allocated for rows and indexes, while a dump file stores rows as SQL text plus the index definitions. The sizes rarely match, and the information_schema figure is the one to report.

Is TABLE_ROWS an exact count of our rows?

Not for InnoDB tables. MySQL's manual says the value can differ from the true count by as much as 40 to 50 percent, so run SELECT COUNT(*) on a table when you need the exact number.

Will mysqldump lock our tables?

Not with --single-transaction on InnoDB tables, because it reads from a consistent snapshot. Without that option, or for tables that use another storage engine, mysqldump locks the tables while it dumps them, and the account needs the LOCK TABLES privilege.

Why is the size query showing old numbers after we loaded a lot of data?

MySQL caches table statistics for 24 hours by default. Run SET SESSION information_schema_stats_expiry = 0; before the query, or run ANALYZE TABLE on the big tables, to get current figures.

Do we need to export MySQL before we apply?

No. The application takes about two minutes and shares no data. You only need your total size in GB, your years of history and your number of accounts for the intro call, and the size query above gives you the first. The full export is needed later, when the records are transferred after you sign the license.

Can we leave out tables that hold sensitive information?

Yes. A dump includes only the databases you name, so the mysql system schema and any payment tables stay out of the files.

What is MySQL data worth to AI labs and data vendors?

A database is priced as part of a whole dataset rather than on its own. Companies are paid $100K to $2M or more per dataset, according to micro1, and the price depends on the years of history and how completely the records show each job. What your data is worth explains the factors.

Bottom line

Know what is in MySQL, then see what it is worth

You don't need to export anything to apply. Apply in two minutes, describe your records on the intro call, and micro1, the data vendor we typically refer companies to, prices the whole dataset and sends an offer 1–2 days later.

Not legal, tax or financial advice. Figures come from micro1's published pages and public reporting as of November 2026.