Cannot enable nginx: mysql_error() expects parameter 1 to be resource, boolean given

Created:

2016-11-16 13:11:37 UTC

Modified:

2017-04-24 11:55:05 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Cannot enable nginx: mysql_error() expects parameter 1 to be resource, boolean given

Applicable to:

  • Plesk 11.5 for Linux

Symptoms

Enabling nginx using /usr/local/psa/admin/bin/nginxmng -e fails with the following error messages:

PleskUtilException: /usr/local/psa/admin/bin/nginxmng '--enable' failed with message: PHP Warning: mysql_query() expects parameter 2 to be resource, boolean given; File: /usr/local/psa/admin/plib/db.php, Line: 97
PHP Warning: mysql_error() expects parameter 1 to be resource, boolean given; File: /usr/local/psa/admin/plib/db.php, Line: 101
PHP Warning: mysql_error() expects parameter 1 to be resource, boolean given; File: /usr/local/psa/admin/plib/db.php, Line: 104

Cause

MySQL connection timeout.

Resolution

  1. Check the following values in /etc/my.cnf :

    # grep 'interactive_timeout' /etc/my.cnf
    interactive_timeout=100

    # grep 'wait_timeout' /etc/my.cnf
    wait_timeout=15
  2. Open /etc/my.cnf in text editor on the server and consider to increase them.

    NOTE: According to MySQL documentation the default value for interactive_timeout and for wait_timeout is 28800

  3. Restart MySQL service:

    # service mysqld restart
  4. Enable nginx:

    # /usr/local/psa/admin/bin/nginxmng -e
Have more questions? Submit a request
Please sign in to leave a comment.