How do I upgrade my MySQL 5.7 database to MySQL 8?

In principle, upgrading the MySQL version is a relatively simple process - the old data must be exported to an SQL file and imported into the new database. This article will guide you through the process and applies to both hosting in the control panel and in the cloud pit.

Schematic upgrade process

  1. Locate the configuration file of your application. This is located directly on the web space, and the exact location varies depending on the application.
  2. Temporarily save the values for the database name, database user, and database password in a file. You will need these values for the MySQL upgrade.
  3. Log in to phpMyAdmin using these values and export the database as an SQL file.
  4. Create a new MySQL 8 database and log into it.
  5. Import the SQL file exported in step 3 into the new database.
  6. Adjust the values for the database name, database user, and database password accordingly in the configuration file of your application so that they match those for the MySQL 8 database.

Once you have successfully completed all steps, your database has been successfully upgraded to MySQL 8 and your application is now using it.

Detailed instructions for WordPress

1. Open your WordPress installation via [Domain] - the affected domain - [Subdomain]. There you will find the entry "Web space content," which shows the location of the WordPress installation.

2. In the specified folder, you will find a file named "wp-config.php," which contains the database information including the password. To access it, go to [Webhosting] - [Web-FTP], right-click on the file "wp-config.php".

3. Use the data found in step 2 to log into the corresponding database via [Webhosting] - [Databases] - [access phpMyAdmin of this database]. Then export the database.

4. Create a new database with MySQL 8 and the same password. Log in via [access phpMyAdmin of this database] as well.

Before you can import the database, you need to edit it. Open the exported database file in a text editor of your choice. Look for the following lines, which are usually located between lines 21 and 24:

-- Database: `XXXX`

--

CREATE DATABASE IF NOT EXISTS `XXXX` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

USE `XXXX`;

Replace "XXXX" with the name of the new database and save the changes.

5. Import the previously exported database into the newly created MySQL 8 database.

6. Now, the host and database name must be adjusted. In the case of WordPress, you can do this in the "wp-config.php" file. Depending on whether you manage your web hosting in our control panel or in the cloud pit, the database server differs.

  • For customers in the control panel, the correct address is mysql80.local:3307.
  • For customers in the cloud pit, it is 127.0.0.1:3307.

Keep the old values for safety in case issues arise.

7. Test whether the website functions correctly with the new MySQL 8 database. This depends on the themes and plugins used. If issues arise, you can always revert to the old database by undoing the changes in the "wp-config.php" file.