Zum Hauptinhalt springen

Database error

Fehlercode: SQLSTATE[HY000] [2002] Connection Refused

Information about the error message: The database is not shared/accessible externally.

Please have a look at the article about sharing the database externally.

SQLSTATE[HY000] [1130] Host ‘XXX.XXX.XXX.XXX’ is not allowed to connect to this MariaDB server

Information about the error message: The user has no rights to connect to this DB.

Please see the post on the topic of creating database users.

Fehlermeldung: SQLSTATE[HY000] [2006] MySQL server has gone away

Information about the error message: This error occurs when importing databases that are either too large or the connection is too slow for the upload.

Troubleshooting: First opens the file my.cnf.

You can find it in the following places:

  • Under XAMPP in Windows you can find this configuration file by default in C:\xampp\mysql\bin\my.cnf.
    • If this file does not exist, you can easily create it by right clicking > "New" > "Text Document".
  • On Linux this file is located by default in etc/mysql/my.cnf

The following variables must now be adjusted in this file. wait_timeout=60 Here you enter the desired timeout in seconds - if this is still too low, you can simply increase it further. max_allowed_packet=100M This variable determines the maximum packet size of the upload. Now set the value of this variable upwards so that it is higher than the file size of the database to be imported. Last but not least, the MySQL server must be restarted and the error should now no longer occur.

** Important:** On live systems, the changed variables should be reset to their default value afterwards, as they could possibly represent a security hole for attackers.