Your site throws "Error establishing a database connection," but when you check the MySQL error log or a debug query, the real message is ERROR 1226 (42000): User 'dbuser' has exceeded the 'max_user_connections' resource (current value: 20) . If that looks familiar, you're not hitting a server-wide MySQL limit β you're hitting a per-account cap, and the fix is completely different from the usual "raise max_connections" advice.
What max_user_connections actually is
MySQL has two separate connection ceilings, and mixing them up wastes a lot of troubleshooting time:
Limit Scope Who sets it Typical error
max_connections Whole MySQL server, all users combined Server admin, in my.cnf ERROR 1040: Too many connections
max_user_connections One specific database user only Per-account grant, or a WHM/cPanel resource limit ERROR 1226: User has exceeded the 'max_user_connections' resource
On shared cPanel hosting, every account usually gets its own database user with its own cap on simultaneous connections β oftenβ¦