Skip to main contentমূল বিষয়বস্তুতে যান

Database

MariaDB or MySQL won’t start: Unable to lock ./ibdata1

The InnoDB message ‘Unable to lock ./ibdata1, error: 11’ usually means another database process already holds the lock on the same data directory. After a crash or out-of-memory event, check which process is active and read the earlier database logs. Leave the tablespace files in place and pause repeated restarts.

Common error messages
InnoDB: Unable to lock ./ibdata1, error: 11
Check the symptoms
MD Mahe Alam Leon, Founder & Lead Engineer, Hostaccent

Technical support led by MD Mahe Alam LeonFounder & Lead Engineer, Hostaccent · 15 years of hands-on server and hosting work · Content checked

About Hostaccent

Are you seeing this?

  • MariaDB or MySQL fails to start, or the service repeatedly tries to start.
  • One or more sites lose database connectivity after a crash or reboot.
  • The database log repeats a lock message while the service manager reports a startup failure.

What usually causes it?

  1. Another instance already uses the data directory

    A running MariaDB or MySQL process can hold the exclusive lock while a second startup attempts to open the same InnoDB system tablespace.

  2. Two service definitions point to the same files

    A manual startup, duplicate service or container mount can direct two instances to one data directory.

  3. A crash or memory event triggered overlapping startup attempts

    Look for the earlier failure in the logs. An OOM kill can explain the original outage, while the lock error points to what is blocking this startup.

Safe checks you can do yourself

  • Read the first failure in the database log

    Note the timestamp and the lines immediately before the lock message. Earlier entries may distinguish a lock conflict from storage errors or crash recovery.

  • Check service and process status

    Use your monitoring or control panel to see whether the database is already running and whether more than one start attempt is visible.

  • Compare the incident against server resources

    Check available disk space, recent memory alerts and the time of any reboot. Record the latest verified backup time.

When to stop and get an expert

  • This is a production database, a shared server or the only copy of current orders or other writes.
  • The logs mention corruption or I/O errors, the service is repeatedly crashing, or there is no verified recovery point.
  • A proposed fix would delete ibdata1, replace the data directory, force recovery or abruptly stop a running instance.
Get Expert Help

How we fix it

  1. Identify and preserve

    With written authorisation, we identify the active instance and confirm the data directory and recovery options before proposing any change.

  2. Resolve the startup conflict

    After repair approval, we address the conflicting startup or underlying resource issue and allow any required crash recovery to complete.

  3. Verify service and data access

    We check the database logs and verify connections from the affected applications. We agree any production write test in advance.

Fixed-price diagnostic

From US$49

We confirm the exact diagnostic fee for one defined issue before you approve it. You receive written findings and a proposed next step. Any repair is quoted and approved separately. There are no automatic charges or hidden fees.

What you receive
A written account of the process or resource issue, the recovery options we verified and the checks required before returning the database to service.
Turnaround
We confirm the diagnostic window after checking access and outage scope. Recovery time depends on the condition of the data and backups.

Case study: ibdata1 lock after an out-of-memory crash

A WooCommerce store's MariaDB kept failing to start with "Unable to lock ./ibdata1, error: 11". A previous MariaDB process was still running after an out-of-memory event and had stalled during crash recovery.

We preserved the data directory first and proved the copy consistent with checksums taken before and after, then rehearsed the recovery on the copy before touching the server.

The database was recovered with no data lost, a second database on the server was verified unchanged, and the memory problem behind the crash was fixed.

Read the full case study

Frequently asked questions

Does error 11 mean the database is corrupt?

Error 11 in this lock message indicates that InnoDB could not obtain an exclusive lock. Check for another instance using the directory and read the preceding log entries for any separate evidence of corruption.

Can I delete ibdata1 and restart?

Leave ibdata1 in place. It is the InnoDB system tablespace and may contain essential database data. Removing it can make recovery harder or cause data loss.

Can running out of memory cause this error?

An OOM kill can take the original service down and trigger recovery or retries. Compare kernel events with the database startup log to identify why the current attempt cannot obtain the lock.

Why would the panel say stopped while a database process exists?

The panel may describe the service it manages. A manually started process or a second service definition can still be using the same files.

What should I send with a support request?

Send the first relevant log lines, outage time, the current service status and the date of the newest verified backup. Remove credentials and sensitive data from log excerpts.

Technical references

Request a diagnostic

Tell us what you saw, when it started and what was affected. An error excerpt with sensitive details removed is enough to start.

Get Expert Help