Find answers to your questions

Documentation

Diagnose a MySQL or MariaDB connection error

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 found or could not find driver point 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.

Related Articles

Check HTTPS and the LiteSpeed WebAdmin certificate The LiteSpeed WebAdmin certificate protects the connection to the web server’s administration interface. Its configuration is separate from your website, cPanel and WHM. A website can therefore work over HTTPS while the console displays a warning, and installing a website certificate does not automatically correct... An LC.8 Error Appeared If you see an LC.8 error appear while using LiteSpeed, then the IP you have been assigned has been placed on the blacklist due to having a nulled version of LiteSpeed installed. Nulled software is illegal and unsafe and will show up on most search engines. When an IP is found to have a nulled version of LiteSpeed,... How to Change the License Key LiteSpeed makes it very easy to change your license key. Simply type the following into the command terminal: cd /usr/local/lsws/conf mv serial.no serial.no.old mv license.key license.key.old echo "" > serial.no cd ../bin ./lshttpd -r ./lswsctrl restart For help with a Nuagerie service, open or follow up on a... How to Check Your License If you want to check your LiteSpeed license, simply log into the LiteSpeed Web console then go to Actions -> Version Management You should see a section with the following information: Type Serial Expiration Date Software Update UltraVPS serial-key Jun 08, 2018 Jun 08, 2018 For help with a Nuagerie service, open or... Prepare a LiteSpeed installation or migration Replacing a web server affects the sites that depend on it. The procedure must suit your control panel, operating system and selected LiteSpeed edition. Check the environmentIdentify the current web server, panel and supported versions.Confirm the license and integration method available for that...