Article ID: 116074, created on May 14, 2013, last review on Aug 12, 2014

  • Applies to:
  • Operations Automation

Symptoms

A customer created website on POA-managed shared hosting server and MySQL database on shared database hosting server. A customer also created own application (or installed some existing web application manually) which needs to work with MySQL database.

Installed application (e.g. PHP script) cannot connect to database, it throws the error message like this:

Could not connect: Lost connection to MySQL server at 'reading initial communication packet', system error: 110

The similar problem may occur in case of PostgreSQL or MS SQL database, error messages provided by customer application may depend on type of the used database.

The article describes the possible reasons of the problem and general steps to troubleshoot it.

Cause

There may be several reasons of the problem with connectivity from web application to database:

  • Network port is closed in firewall

  • Problems with routing

  • Database server is down

  • Wrong database server IP/hostname is used

  • Wrong database user and/or password is used

Resolution

  1. Make sure that the following network ports are open in firewall for connections between shared web hosting servers and database servers:

    3306 MySQL database server

    5432 PostgreSQL database server

    1433 Microsoft SQL Server

    Use the telnet utility on a shared web hosting server to check connectivity to the proper port on a database server, e.g.:

    telnet DB_SERVER PORT
    

    Replace DB_SERVER with the IP address or hostname of the database server and PORT with the proper network port from the list above.

    Note: the listed above network ports are the default ones, actual ports used by a particular database server may be different. Consult with your database administrator to find the needed network port in case of non-default one.

  2. If required network ports are open in firewall and connection from shared web hosting server to database server still cannot be established then check routing between servers - make sure that it is configured properly. Try to connect from shared web hosting server to other ports on database server (e.g. use the simplest ping utility) to check if problem affect only some particular ports or the problem is due to the wrong routing rules.

  3. If connection between shared web hosting server and database server in general may be established (e.g. it is possible to ping database server) and still connection to database server does not work then check if database server is up and running, .e.g. use the commands below on database server:

    MySQL for Linux:

    service mysql status
    

    PostgreSQL for Linux:

    service postgresql status
    

    Microsoft SQL Server:

    net start | find "SQL Server"
    
  4. Make sure that correct database name, IP address or hostname of database server and network port are used in customer web application to connect to database server. The correct values may be found in POA Customer Control Panel at Parallels Panel > More Services > Databases > General tab:

    1

    Note: If you need to provide to customers the external access to their MySQL and PostgreSQL databases, create the 'Access to db from external hosts' Resource Type on the basis of the 'Access to db from external hosts' Resource Class and include this Resource Type into the Service Template for web hosting. A customer having the 'Access to db from external hosts' resource in their subscription can enable the access from the allowed external hosts to own MySQL or PostgreSQL databases.

  5. Make sure that the correct database user and password are used in customer web application to connect to database server. The list of database users for a particular database may be found in POA Customer Control Panel at Parallels Panel > More Services > Databases > Users tab:

    2

    Try to change database user password in POA Customer Control Panel to the one which is used in customer web application to make sure that the correct password is used.

Search Words

hosting database

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF