1202
MySQLERRORNotableReplicationHIGH confidence

Could not create slave thread

Production Risk

High — replication cannot start; replica falls further behind.

What this means

ER_SLAVE_THREAD (1202, SQLSTATE HY000) is raised when MySQL cannot create the I/O or SQL replication threads, usually due to insufficient system resources.

Why it happens
  1. 1Thread creation limit reached (too many threads already running)
  2. 2Operating system thread limit exceeded
  3. 3Insufficient memory to spawn new threads
How to reproduce
trigger — this will error
trigger — this will error
START SLAVE;  -- fails if thread cannot be created

expected output

ERROR 1202 (HY000): Could not create slave thread; check system resources

Fix

Check system resource limits

Check system resource limits
SHOW STATUS LIKE 'Threads_running';
SHOW VARIABLES LIKE 'thread_stack';

Why this works

Identify current thread usage. Reduce other workloads or increase OS thread limits (ulimit) if needed.

Sources
Official documentation ↗

MySQL 8.0 — 1202 ER_SLAVE_THREAD

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors