---
title: Database problems
description: "- connect to the server via SSH and run: - the output should contain running, if not, start the service: - after starting MySQL, check the site. If it doesn't work, go to the next step. - check for fr"
---

[Skip to content](https://help.ishosting.com/en/database-problems#main-content)

- [English](https://help.ishosting.com/en/database-problems)
- [Русский](https://help.ishosting.com/ru/database-problems)

English

Show submenu for translations

[![is\*hosting](https://help.ishosting.com/hubfs/Logo_Ishosting_mono-1.svg)](https://help.ishosting.com/en)

- [Blog](https://blog.ishosting.com/en)
- [Support](https://my.ishosting.com/en/tickets)

Open main navigation

Close main navigation

- [Blog](https://blog.ishosting.com/en)
- [Support](https://my.ishosting.com/en/tickets)
- - [English](https://help.ishosting.com/en/database-problems)
    - [Русский](https://help.ishosting.com/ru/database-problems)

  English
  
  Show submenu for translations
- [Go to ishosting.com](https://ishosting.com/)

[Go to ishosting.com](https://ishosting.com/)

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://help.ishosting.com/en)
2. [Server Administration](https://help.ishosting.com/en/server-administration)
3. [UNIX Instructions](https://help.ishosting.com/en/server-administration#unix-instructions)

# Database problems

### DATABASE NOT AVAILABLE

#### 1. Check MySQL

\- connect to the server via SSH and run:

```
service mysql status
```

\- the output should contain **running**, if not, start the service:

```
service mysql start
```

\- after starting MySQL, check the site. If it doesn't work, go to the next step.

#### 2. Check disk space

\- check for free space:

```
df -h
```

\- if there is not enough free space on the disk - you can expand the disk or delete unnecessary files. For a detailed analysis of the disk space state and deleting files, it is better to use special utilities [du or ncdu](https://help.ishosting.com/en/disk-space-analysis-ncdu-du).

\- if there is free space on the disk, but applications displays an error about not enough space - check [inodes](https://help.ishosting.com/en/overflow-inodes).  

### RESTORE DB TABLES

If the site displays errors **Warning: Table './database/table' is marked as crashed** –

repair damaged tables.               

\- If phpMyAdmin is installed on your VPS server, go to its interface and select the required database. Highlight the tables that were reported corruption in errors. From the **Marked** menu, select **Recover**.

\- You can also restore tables from the console.

Connect to the server via SSH. To restore a **table\_name** in **base\_name**, run:

```
mysqlcheck -r base_name table_name -uroot –p
```

To restore all tables in the **base\_name** database run:

```
mysqlcheck -r base_name -uroot -p
```

To check all tables in the database, run:

```
mysqlcheck -r -A -uroot -p
```

### MYSQL SERVER HAS GONE AWAY (ERROR 2006)

This error indicates that the server has closed the connection. This could be due to a timeout or an oversized packet received.

To fix the error, connect to the server via SSH. The configuration file can be located in various directories, for example:

```
/etc/my.cnf/etc/mysql/mysql.conf.d/mysqld.cnf/etc/mysql/my.cnf
```

To find the file with the required settings, use the following command:

```
grep -Rl 'name' /etc/*
```

The command to search for a file with settings for the acceptable size of received packets:

```
grep -Rl 'max_allowed_packet' /etc/*
```

The command to search for a file with timeout settings:

```
grep -Rl 'wait_timeout' /etc/*
```

#### **1. Timeout increase**

Open the configuration file using an editor.

```
nano /etc/mysql/mysql.conf.d/mysqld.cnf
```

Increase wait\_timeout. The timeout in the configuration file is specified in seconds. To set a timeout of 5 minutes, specify a value of 300:

```
wait_timeout = 300
```

Restart MySQL:

```
service mysql restart
```

#### **2. Increasing the allowed packet size**

Change the **max\_allowed\_packet** parameter. Open the configuration file using an editor.

```
 nano /etc/mysql/mysql.conf.d/mysqld.cnf
```

Increase **max\_allowed\_packet** as needed. The maximum allowable packet size is indicated in megabytes. To set the maximum packet size to 128 megabytes, enter:

```
max_allowed_packet = 128M
```

Restart MySQL to apply changes:

```
service mysql restart
```

### TOO MANY CONNECTIONS (ERROR 1040)

This error indicates that the maximum number of connections to the database has been reached. Reasons for the error:

1\. Slow queries that take a long time. Only optimization of the database code can solve this problem.

2\. A large number of concurrent connections. This problem can be resolved by changing the maximum connections setting in the MySQL configuration file.

Find the path to the file containing the parameter **max\_connections**:

```
grep -Rl 'max_connections' /etc/*
```

Increase the maximum number of concurrent connections (for example, up to 150):

```
max_connections = 150
```

Restart MySQL to apply changes:

```
service mysql restart
```

### INCORRECT DATE VALUE (ERROR 1292)

This error can be caused to a MySQL table without specifying a date.

1\. Open the configuration file to find the error. For example:

```
nano /etc/mysql/mysql.conf.d/mysqld.cnf
```

2\. On the **sql-mode =** line, remove:

```
NO_ZERO_IN_DATENO_ZERO_DATESTRICT_ALL_TABLES
```

3\. If the **sql-mode =** line is missing in the config file, add the following line:

```
sql-mode="ONLY_FULL_GROUP_BY,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
```

4\. Restart MySQL to apply changes:

```
service mysql restart
```

[More database examples](https://blog.ishosting.com/en/types-and-features-of-databases).

If you have any questions, please create a [**ticket to technical support**](https://ishosting.com/en/support).

- [Virtual Private Servers](https://help.ishosting.com/en/virtual-private-servers#main-content)

    - [Getting Started](https://help.ishosting.com/en/virtual-private-servers#getting-started)
    - [Working with VPS](https://help.ishosting.com/en/virtual-private-servers#working-with-vps)
    - [Software](https://help.ishosting.com/en/virtual-private-servers#software)
    - [Backup and Data Storage](https://help.ishosting.com/en/virtual-private-servers#backup-and-data-storage)
    - [Additional Services](https://help.ishosting.com/en/virtual-private-servers#additional-services)
    - [VPS Load](https://help.ishosting.com/en/virtual-private-servers#vps-load)
    - [Other Issues](https://help.ishosting.com/en/virtual-private-servers#other-issues)
- [Dedicated Servers](https://help.ishosting.com/en/dedicated-servers#main-content)

    - [Getting Started](https://help.ishosting.com/en/dedicated-servers#getting-started)
    - [Working with Dedicated Server](https://help.ishosting.com/en/dedicated-servers#working-with-dedicated-server)
    - [Additional Services](https://help.ishosting.com/en/dedicated-servers#additional-services)
    - [Other Issues](https://help.ishosting.com/en/dedicated-servers#other-issues)
- [Server Administration](https://help.ishosting.com/en/server-administration#main-content)

    - [API](https://help.ishosting.com/en/server-administration#api)
    - [Windows Instructions](https://help.ishosting.com/en/server-administration#windows-instructions)
    - [UNIX Instructions](https://help.ishosting.com/en/server-administration#unix-instructions)
    - [ispmanager](https://help.ishosting.com/en/server-administration#ispmanager)
    - [VestaCP](https://help.ishosting.com/en/server-administration#vestacp)
    - [DirectAdmin](https://help.ishosting.com/en/server-administration#directadmin)
    - [BitrixVM](https://help.ishosting.com/en/server-administration#bitrixvm)
    - [Security](https://help.ishosting.com/en/server-administration#security)
    - [DDoS Protection](https://help.ishosting.com/en/server-administration#ddos-protection)
    - [Working with Files](https://help.ishosting.com/en/server-administration#working-with-files)
    - [Databases](https://help.ishosting.com/en/server-administration#databases)
    - [PHP](https://help.ishosting.com/en/server-administration#php)
    - [Logs and Statistics](https://help.ishosting.com/en/server-administration#logs-and-statistics)
    - [Diagnostics and Troubleshooting](https://help.ishosting.com/en/server-administration#diagnostics-and-troubleshooting)
    - [HestiaCP](https://help.ishosting.com/en/server-administration#hestiacp)
    - [cPanel](https://help.ishosting.com/en/server-administration#cpanel)
    - [aaPanel](https://help.ishosting.com/en/server-administration#aapanel)
    - [FastPanel](https://help.ishosting.com/en/server-administration#fastpanel)
    - [Other](https://help.ishosting.com/en/server-administration#other)
- [Mail](https://help.ishosting.com/en/mail#main-content)

    - [Getting Started](https://help.ishosting.com/en/mail#getting-started)
    - [ispmanager](https://help.ishosting.com/en/mail#ispmanager)
    - [DirectAdmin](https://help.ishosting.com/en/mail#directadmin)
    - [VestaCP](https://help.ishosting.com/en/mail#vestacp)
    - [Other Issues](https://help.ishosting.com/en/mail#other-issues)
- [VPN](https://help.ishosting.com/en/vpn#main-content)

    - [Getting Started](https://help.ishosting.com/en/vpn#getting-started)
    - [Android](https://help.ishosting.com/en/vpn#android)
    - [iOS](https://help.ishosting.com/en/vpn#ios)
    - [macOS](https://help.ishosting.com/en/vpn#macos)
    - [Mikrotik](https://help.ishosting.com/en/vpn#mikrotik)
    - [Linux](https://help.ishosting.com/en/vpn#linux)
    - [Windows](https://help.ishosting.com/en/vpn#windows)
    - [Amnezia VPN](https://help.ishosting.com/en/vpn#amnezia-vpn)
    - [Hysteria](https://help.ishosting.com/en/vpn#hysteria)
- [Data Storage](https://help.ishosting.com/en/data-storage#main-content)

    - [Getting Started](https://help.ishosting.com/en/data-storage#getting-started)
    - [Backups](https://help.ishosting.com/en/data-storage#backups)
    - [Other](https://help.ishosting.com/en/data-storage#other)
- [SSL Certificates](https://help.ishosting.com/en/ssl-certificates#main-content)

    - [Getting Started](https://help.ishosting.com/en/ssl-certificates#getting-started)
    - [Install](https://help.ishosting.com/en/ssl-certificates#install)
- [Affiliate Program](https://help.ishosting.com/en/affiliate-program)
- [Additional Services](https://help.ishosting.com/en/additional-services#main-content)

    - [Additional IP](https://help.ishosting.com/en/additional-services#additional-ip)
    - [Control Panels](https://help.ishosting.com/en/additional-services#control-panels)
    - [Antivirus](https://help.ishosting.com/en/additional-services#antivirus)
- [Client Area](https://help.ishosting.com/en/client-area#main-content)

    - [Balance History](https://help.ishosting.com/en/client-area#balance-history)
- [Payment for Services](https://help.ishosting.com/en/payment-for-services#main-content)

    - [Getting Started](https://help.ishosting.com/en/payment-for-services#getting-started)
    - [My Account](https://help.ishosting.com/en/payment-for-services#my-account)
    - [Payments](https://help.ishosting.com/en/payment-for-services#payments)
    - [Other Issues](https://help.ishosting.com/en/payment-for-services#other-issues)
- [Documents and Policies](https://help.ishosting.com/en/documents-and-policies#main-content)

    - [General](https://help.ishosting.com/en/documents-and-policies#general)
    - [Company](https://help.ishosting.com/en/documents-and-policies#company)
- [Questions and Answers](https://help.ishosting.com/en/questions-and-answers#main-content)

    - [Control Panels](https://help.ishosting.com/en/questions-and-answers#control-panels)
    - [ispmanager](https://help.ishosting.com/en/questions-and-answers#ispmanager)
    - [Windows](https://help.ishosting.com/en/questions-and-answers#windows)
    - [Linux](https://help.ishosting.com/en/questions-and-answers#linux)
    - [Mail](https://help.ishosting.com/en/questions-and-answers#mail)
    - [Other](https://help.ishosting.com/en/questions-and-answers#other)
- [Special Offers](https://help.ishosting.com/en/special-offers)
- [is\*smart](https://help.ishosting.com/en/issmart#main-content)

    - [General Info](https://help.ishosting.com/en/issmart#general-info)
    - [Getting Started](https://help.ishosting.com/en/issmart#getting-started)
    - [API](https://help.ishosting.com/en/issmart#api)
    - [AI Models](https://help.ishosting.com/en/issmart#ai-models)
- [List of Apps](https://help.ishosting.com/en/list-of-apps)

[![is\*hosting](https://help.ishosting.com/hubfs/ishosting-logo-black.svg "is*hosting")](https://ishosting.com)

<https://www.facebook.com/ishostingcom> <https://twitter.com/ishostingcom> <https://www.instagram.com/is.hosting> <https://www.youtube.com/@ishosting> <https://www.linkedin.com/company/is-hosting>

Copyright © 2025, © Webrain OÜ