en
Language
  • en
  • cs
  • hu
  • de
  • fr
  • es
  • br
  • ru
  • kr
  • jp
AI translation
  • it
  • pl
  • tr

How to Maintain Database Version

Introduction

If you are using the server solution of Easy8, you are fully responsible for maintaining the infrastructure—including your database. This article explains how to keep your MySQL or MariaDB version up to date and what to do if you encounter SQL syntax errors during updates.

Target Audience

  • Administrator

Prerequisites

Before starting, ensure you have:

  • Access to your Easy8 server with root or sudo permissions
  • The ability to back up your current database
  • Debian 10 (officially supported by Easy Software)

Always back up your data before performing an upgrade.

When to Update

You may see the following error during an application update:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ...

Cause

This error indicates your database version is outdated and doesn’t support the syntax used by the current Easy8 version.

Solution

Update your MySQL or MariaDB to a supported version:

  • MySQL: 5.7 or higher
  • MariaDB: 10.3 or higher

Step-by-Step: MySQL Upgrade

1. Backup All Databases

mysqldump --all-databases > all_databases.sql

2. Download APT Config Package


wget https://dev.mysql.com/get/mysql-apt-config_0.8.13-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.13-1_all.deb

Select the desired version (e.g., 5.8) in the configuration dialog.

3. Update Package List

sudo apt-get update

4. Install the New MySQL Server

sudo apt-get install mysql-server

5. Upgrade Databases

sudo mysql_upgrade -u root -p

6. Restart MySQL

sudo /etc/init.d/mysql restart

Step-by-Step: MariaDB Upgrade

1. Backup Database


mariadb-backup --user=mariabackup_user \
               --password=mariabackup_passwd \
               --target-dir=/backup/preupgrade_backup

2. Prepare Backup

sudo mariadb-backup --prepare --target-dir=/backup/preupgrade_backup

3. Stop MariaDB

sudo systemctl stop mariadb

4. Remove Old Packages


sudo apt remove "mariadb-*"
sudo apt remove galera-4   # or `galera` if using older versions

5. Verify Uninstallation

apt list --installed | grep -i -E "mariadb|galera"

6. Setup Repository and Install New Version


sudo apt install wget
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

echo "2de6253842f230bc554d3f5ab0c0dbf717caffbf45ae6893740707961c8407b7 mariadb_repo_setup" | sha256sum -c -
chmod +x mariadb_repo_setup

sudo ./mariadb_repo_setup --mariadb-server-version="mariadb-10.5"
sudo apt update
sudo apt install mariadb-server mariadb-backup libmysqlclient-dev

7. Upgrade Data Directory

sudo mariadb-upgrade

Conclusion

Keeping your database version up to date is essential for the correct functioning of Easy8. Regular updates prevent syntax errors and ensure compatibility with new application features. Always test and back up before upgrading.

Related Topics and Further Reading

Try Easy8 in 30 days free trial

Access all features, SSL protected, no credit card required.