Skip to content
Hosting · Rincian error

MySQL connection errors

Communications link failure, Access denied, Too many connections: analysis of common database errors and what to check.

Diperbarui 13 Agustus 2026

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
java.sql.SQLException: Access denied for user
java.sql.SQLException: Too many connections

Diagnosis

ErrorCause
Communications link failureDatabase unavailable: wrong host/port, database is off, network
Access deniedWrong login or password, or access from this address is denied
Unknown databaseThe database name is wrong
Too many connectionsConnection limit reached: plugins are using a pool that is too large
Table doesn't existThe plugin didn't create its tables: check the database user's permissions

What to check

  1. The credentials from the control panel were copied in full — MySQL database.
  2. Are you connecting from ANOTHER one of your own servers? Then you need two things: the “Shared database for my servers” checkbox enabled and the port from the “Connecting from your other servers” block — the other machine reaches the database on a different port. Access denied for user ... @'172.18.0.1' is almost always this.
  3. The port is specified separately from the host.
  4. The password has no trailing space.
  5. The plugin starts after the database becomes available: an unavailable database stalls startup — Server takes a long time to start.

Too many connections

Every plugin keeps a connection pool. Five plugins with 10 connections each is already 50. Reduce the pool size in the configs:

pool-settings:
  maximum-pool-size: 5
  minimum-idle: 2

For a plugin that hits the database once a minute, a pool of ten connections is pointless — MySQL for plugins.

Hosting MinecraftServer Anda berjalan saat Anda offlineBuat server