Error: Coppermine critical error - Unable to connect to database - MySQLi said 1203 : User {database-username} already have more than "max_user_connections" active connections.
Reason: Your account has reached the limit of active connections for your coppermine database. This limit is in place to prevent a single website from crashing the SQL server.
How to Fix: Reduce database connections. The larger your database (the more photos you have), the slower SQL queries take to complete.
- The easiest way to reduce database usage is to turn off settings for the "front page" of coppermine gallery. See this article to find out how.
- A harder way to reduce database usage is to remove photos. Many galleries add way too many screencaps that almost never get "viewed" by anyone. Removing some or all of these screencaps will reduce database usage. You could also "split" your gallery into multiple galleries (one for screencaps, one for appearances, etc). Doing this allows your account more database connections as the limits are per database, not per user.
- Turn off detailed statistics in coppermine gallery settings. NEVER turn this on!! To configure statistics in Coppermine Gallery, access the Admin Menu and look for Config to disable statistics, by default this is turned off for a reason as detailed statistics can increase database load and table size, so use external tools like Google Analytics for tracking. *If this was ever turned on in the past then you can also remove the rows of data from the database to reduce it's size.
- Turn off CPMfetch or any other plugin that may be using the coppermine database.
- Upgrade your account. The more resources your account has available the faster it is capable of processing database queries. ***This likely won't help extremely large/busy galleries. Extremely large/busy galleries may need to look into a VPS or Dedicated server for optimal performance.
- Disable the "main page" of coppermine. You can manually re-create your "main page" in wordpress linking directly to your subcategories. then add a redirect for the coppermine "main page" to the manually created page in wordpress. Doing this will prevent the largest SQL queries from occurring, greatly speeding up your gallery load times.
- Block "bad bots" or "scrapers" that may be crawling your site constantly, which makes the issue worst. You can do this by viewing Awstats for abusers and then using .htaccess to block their IP. You can also block entire countries using this technique.
The more traffic your website has the more likely you are to see these issues.