A MySQL or MariaDB error can involve the application, its PHP environment, connection settings or the database service. The exact message helps identify the appropriate check. Record the facts before changing several settings at once.
Record the failure context
Keep the complete message, any error code, the time and time zone, and the affected action: opening the website, signing in, placing an order, importing data or running a scheduled task. State whether the problem is continuous or intermittent and whether it followed a migration, update or PHP change. Remove passwords, tokens and personal information before sharing an excerpt.
Match the message to a useful check
- Missing extension or driver: messages such as
Class mysqli not foundorcould not find driverpoint toward the PHP module expected by the application. Check the PHP version actually used by the website and whether MySQLi or PDO MySQL is available as required. Our PHP selection guide helps prepare that check. - Access denied: review the database account, its credentials and its permissions for this connection. An incorrect password is one possibility, but the message can also concern the allowed host or requested privileges.
- Unknown database: check the exact database name, any account prefix and the intended server. Creating an empty database with a similar name does not restore the website’s expected data.
- Can't connect, connection refused or timeout: have the expected host, port or socket confirmed, followed by service availability and the network route. If the hostname cannot be resolved, investigate that resolution first.
- Too many connections, Lost connection or server has gone away: record the frequency, operation and workload at the time. These messages need contextual investigation rather than automatically raising limits or restarting services.
Distinguish sockets from network connections
On Unix, MySQLi can use a local socket when the host is localhost, while 127.0.0.1 requests TCP. These values are not always interchangeable. A socket error does not establish database corruption. The PHP connection documentation and MySQL connection guide explain the mechanisms to investigate.
Keep the correction specific
In cPanel, inspect databases and users for the correct account. Check their association and the privileges the application requires without broadly expanding access. The database management documentation explains these elements. If changing a password, coordinate the update across applications that use it.
For managed hosting, ask support to check the service, modules and server logs. A connection error does not routinely require recompiling PHP. Avoid publishing a phpinfo() page when seeking help because it can expose configuration details. Before an application change, retain the previous configuration and a backup appropriate to the affected data.
Move the diagnosis forward with Nuagerie
Open a request in your client area with the domain, context and a sanitized error excerpt. Our team can help distinguish a connection setting, missing module and service incident. After correction, verify the failing workflow and related tasks rather than relying only on a working homepage.