Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsThe safest MySQL 5.7-to-8.0 migration on a Linux VPS is a rehearsed move with a verified backup, not an untested package command. First inventory the server and choose between a logical dump-and-restore and a supported in-place package upgrade. Test the chosen route on a representative VPS, keep a copy of the backup off-server, and schedule production downtime for the final cutover. MySQL 8.0 cannot be downgraded normally to 5.7 or to an earlier 8.0 release, so your pre-upgrade backup is the rollback plan.
Need a server to try this on? Antihost offers Linux VPS plans with NVMe storage, full root access and a 14-day free trial.
What changes when you move to MySQL 8?
MySQL 8 is a major release change. The server, SQL behavior, authentication, collations, reserved words, plugins and client interfaces may differ from MySQL 5.7. SQL exported from the older server can fail when a feature has been changed, deprecated or removed. Treat the migration as both a data move and an application-compatibility project.
As an Amazon Associate I earn from qualifying purchases.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Oracle describes a logical upgrade as exporting SQL from the old instance with a utility such as mysqldump or mysqlpump, installing the new server and applying that SQL to the new instance. An in-place upgrade keeps the existing data directory and updates packages, but it is supported only for an installation and repository path that MySQL explicitly supports.
Choose logical migration or in-place upgrade
Use the following decision table before changing a package or stopping production writes.
#1 Best Overall
| Decision factor | Logical dump and restore | In-place package upgrade |
|---|---|---|
| Changing VPS, Linux distribution or installation layout | Best fit. Install a clean MySQL 8 target and import the SQL. | Usually unsuitable because the existing installation and data directory are not being carried to a supported target in the same way. |
| Changing from MariaDB, Percona Server or another fork | Preferred starting point; review exported SQL and fork-specific features. | Use only when the exact vendor and repository path document a supported upgrade. |
| Downtime | Depends on dump, transfer and import duration; a final dump requires writes to stop or be coordinated. | Usually shorter package-maintenance downtime, but the server restarts after the update. |
| Rollback | Restore the pre-migration backup to a MySQL 5.7 server or revert the original VPS snapshot after stopping MySQL 8. | Restore the pre-upgrade backup or snapshot; do not rely on downgrading packages. |
| Large data volume | Requires enough time and temporary storage for export, transfer and import; rehearse the duration. | Avoids a full SQL transfer but still needs a tested upgrade path and conversion work. |
| SQL compatibility work | Import errors are visible during the restore and can be corrected before cutover. | Compatibility problems appear during startup or application testing on the upgraded data directory. |
| Plugins, keyrings and encryption | Reinstall and configure them on the target, then verify access to encrypted data. | Confirm that every installed plugin, keyring setting and encryption component is supported by the selected 8.0 packages. |
| Testability | Easy to repeat on a disposable VPS with the same dump. | Clone or snapshot the complete installation and rehearse the package sequence. |
If the host, distribution or database engine is changing, choose logical migration unless the vendor documentation for your exact combination says otherwise. If you are staying on the same supported Linux installation and MySQL repository path, an in-place upgrade may be appropriate after a full rehearsal.
Inventory the current VPS
Make a written inventory before taking a backup. It becomes the checklist for rebuilding the target and diagnosing differences after cutover.
- Record the current MySQL version and release, Linux distribution and release, CPU architecture, and the location of the data directory.
- Identify how MySQL was installed: the distribution package, MySQL APT or Yum repository, a binary tarball, a container, or a MariaDB/Percona-derived installation.
- List every application database, the
mysqlsystem database, users, grants, authentication plugins, stored procedures and functions, scheduled events, triggers and views. - Document replication topology, read-only replicas, scheduled jobs, backup timers, service overrides and monitoring checks.
- Record keyring or encryption configuration, custom plugins, TLS certificates, socket and port settings, character sets, collations and SQL modes.
- List every application connector and language interface, including PHP MySQL extensions, Perl
DBD::mysql, JDBC, ODBC or framework-specific drivers. - Measure database size, free disk space, dump location, expected transfer speed and the longest acceptable maintenance window.
Save configuration files and service definitions separately from the database backup. A clean target can then be rebuilt without guessing which options were locally customized.
Back up and rehearse recovery
Take a complete backup before changing packages or stopping the old server. Include all application databases and the mysql system database; the latter contains account and privilege information needed to reproduce access. Keep at least one copy outside the VPS so a damaged disk, failed package transaction or accidental deletion does not destroy both the live data and its recovery copy.
Verify that the backup is readable and perform a trial restore on a disposable Linux VPS. A file that was created successfully is not proof that it can be imported. Check that the restored server starts, users can authenticate, routines and events exist, and representative application queries return expected results. Record how long the restore takes and how much temporary disk space it needs.
MySQL states that a downgrade from 8.0 to 5.7, or from one 8.0 release to an earlier 8.0 release, is unsupported. Consequently, the pre-upgrade backup, snapshot or a separately preserved old VPS is the rollback mechanism. Do not plan to install older packages over a modified MySQL 8 data directory.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Test compatibility on a representative instance
Oracle recommends performing the procedure on test systems first and then on production. Clone a representative database, not an empty schema. Include the largest tables, unusual data, routines, events, generated columns, views, authentication methods and the queries that matter to your application.
Run the test sequence
- Create a test VPS with the target Linux family and the same storage class, memory and MySQL 8 repository series you intend to use in production.
- Restore a recent copy of the old data, or use the logical dump that will be used for the final migration.
- Install or upgrade to MySQL 8 using the selected procedure, then inspect the startup and error logs before connecting the application.
- Run schema migrations and application initialization exactly as production will run them.
- Exercise authentication, reads, writes, transactions, reporting queries, background jobs, stored routines and scheduled events.
- Check for failures caused by reserved words, SQL modes, character sets, collations, generated columns, authentication plugins or removed and deprecated features.
- Rebuild or reinstall language interfaces after the release change. MySQL specifically calls out interfaces such as PHP MySQL extensions and Perl
DBD::mysql; do not assume an existing binary module remains compatible. - Measure import time, startup time, query latency and application error rates. Use those measurements to set the production maintenance window.
Resolve errors in the exported SQL, schema migrations or application code before scheduling production. The --force option shown in the dump example allows the dump process to continue past some errors; it does not make the resulting migration safe.
Logical migration: dump, install and restore
Logical migration is the most portable route when you are changing hosts, distributions or database forks. It also gives you a clean target and a repeatable restore.
1. Prepare the old server
Confirm that the old server is healthy, has enough space for the dump and that no backup or schema job will alter data unexpectedly during export. For a consistent production export, use the transaction and locking options appropriate to your storage engines and workload; rehearse those options on the test VPS rather than inventing a new command during the outage.
Free tools Windows power users keep installed
One-click scans. No signup required.
2. Export databases, routines and events
The official example for a complete SQL export is:
mysqldump -u root -p --add-drop-table --routines --events --all-databases --force > data-for-upgrade.sql
--all-databases includes the mysql system database as well as application schemas. --routines and --events preserve stored procedures, functions and scheduled events. If your application depends on triggers, views, tablespaces, encryption metadata or other installation-specific objects, verify in the test restore that the chosen utility and options captured them. Keep the command output and error messages; review every reported error.
3. Transfer and protect the dump
Copy the SQL file to storage outside the source VPS and to the target only over an authenticated, protected channel. Restrict file permissions because the dump can contain credentials, personal data and all application records. Confirm the file size and, where your operational process supports it, a checksum at the source and destination.
4. Install and initialize MySQL 8 on the target
Install MySQL 8 with the distribution-supported method, initialize the data directory as required by that distribution, enable the service and start it with systemd where applicable. Apply the target configuration for ports, sockets, TLS, keyrings, memory and storage only after confirming that each option is valid for MySQL 8. Do not copy an old configuration wholesale without reviewing removed or changed variables.
5. Import and inspect errors
Import the dump with a MySQL client that matches the target server. Capture the client output and server error log. Stop and investigate syntax, privilege, character-set, collation, plugin or object-definition errors instead of treating a completed command as proof of success. Correct the SQL or target configuration, reset the test instance if necessary, and repeat until the restore is clean and reproducible.
6. Recreate and verify access
Check that users, grants, authentication plugins, routines, events, triggers, views and scheduled jobs are present. If an object could not be carried across, recreate it deliberately on MySQL 8 and document the change. Reinstall any required plugins and verify keyring or encryption access before exposing the server to the application.
7. Validate the restored data
Compare table and row counts, selected checksums or application-level invariants between source and target. Run representative read and write transactions, including transactions that exercise foreign keys, generated columns, reporting views and background workers. Validate the application with the same connector versions that will be used after cutover.
In-place upgrade with APT on Ubuntu or Debian
Use this route only when the installation came from a supported APT path and the MySQL repository documents the upgrade. In the MySQL APT setup, select the MySQL 8.0 release series before updating package metadata. Do not select a lower series than the one already installed; that would be an unsupported downgrade operation.
- Take and verify the full backup described above, and rehearse the package sequence on a clone or test VPS.
- Open the MySQL APT repository configuration and select the 8.0 series for the matching Linux distribution.
- Update package metadata:
sudo apt-get update
- Install or update the server package:
sudo apt-get install mysql-server
- Expect the server to restart after the package update. Watch the package output and the MySQL error log for startup failures.
- After the service is available, verify the version, accounts, grants, plugins, scheduled events, replication and application connections before reopening traffic.
APT does not turn an unsupported installation into a supported one. If the existing server came from a fork, a tarball or a custom data-directory layout, use a logical migration or follow the exact vendor procedure for that installation instead.
In-place upgrade with Yum or DNF on Enterprise Linux or Fedora
For systems using the MySQL Yum repository, the 5.7 subrepository must be disabled and the 8.0 series enabled before updating. Leaving 5.7 selected does not automatically move the installation to 8.0.
- Verify the backup and complete a test upgrade on a representative clone.
- In the repository configuration, disable the MySQL 5.7 subrepository and enable the MySQL 8.0 subrepository.
- Update the server with the package manager used by the distribution:
sudo yum update mysql-server
or:
sudo dnf upgrade mysql-server
- Expect a service restart after the package update. Review the transaction output and startup log for conversion or configuration errors.
- Verify
SELECT VERSION(), users, grants, plugins, replication, scheduled jobs and application smoke tests before directing production traffic to the upgraded server.
Cut over with controlled downtime
For a logical move, schedule a maintenance window long enough for the final export, transfer, import and validation measured during rehearsal. Announce the write freeze, stop or drain application workers that can write to MySQL, and prevent background jobs from changing data while the final dump is taken. If replication or another catch-up mechanism is part of your design, confirm its lag and failure behavior before the window.
- Put the application into maintenance or read-only mode and stop write-producing workers.
- Take the final consistent dump or complete the planned replication catch-up.
- Import or finish the package upgrade on the target and inspect logs.
- Run the validation checklist: version, service health, accounts and grants, row counts or invariants, routines, events, replication, connector connectivity and representative transactions.
- Change the application connection endpoint, DNS record or configuration to the MySQL 8 server.
- Re-enable workers and writes gradually while monitoring errors, latency, connections, locks and disk usage.
- Keep the old server powered off or isolated until the agreed rollback period has passed; do not allow accidental writes to both servers.
Post-upgrade verification checklist
- Server:
SELECT VERSION()reports the intended MySQL 8 release, the service starts after reboot, and the error log is free of unresolved conversion or plugin failures. - Accounts: Application users can authenticate with the expected plugin, have the intended grants and cannot access accounts that should have been removed.
- Data: Critical table counts, checksums or business invariants match the source, and recent writes are visible from the application.
- SQL behavior: Queries using generated columns, reserved words, SQL modes, character sets and collations have passed the representative test suite.
- Programmability: Stored routines, triggers, views and scheduled events exist and execute successfully.
- Operations: Backups, monitoring, log rotation, TLS, keyring access, replication and scheduled maintenance jobs run against the new instance.
- Clients: PHP MySQL extensions, Perl
DBD::mysqland other connectors have been rebuilt or reinstalled as recommended for the release change.
Do you need to run mysql_upgrade?
From MySQL 8.0.16 onward, mysql_upgrade is not a separate required step. The server performs those upgrade tasks during startup. Do not add an obsolete standalone command to an otherwise correct runbook. Instead, inspect startup output and error logs, then perform the account, schema, routine and application checks listed above.
Recommended Free Tools
Rollback when MySQL 8 breaks the application
Stop writes as soon as a serious post-cutover fault is confirmed. Preserve the MySQL 8 logs and the failing query or application error so the cause can be diagnosed without changing more data.
- Put the application back into maintenance mode and stop workers.
- Prevent traffic from reaching the MySQL 8 instance.
- Restore the pre-upgrade backup to a MySQL 5.7 server or revert the preserved pre-upgrade VPS snapshot. Do not attempt an ordinary package downgrade of the modified MySQL 8 data directory.
- Validate the restored server with authentication, grants, row counts and representative transactions.
- Point the application back to the restored endpoint, then reconcile any writes that occurred after the cutover from logs or application records.
- Investigate the compatibility failure on a disposable clone, correct the SQL, connector, plugin or configuration issue, and repeat the test before another production attempt.
A rollback can lose writes made after the migration point unless you have a separately tested change-capture or reconciliation process. Define that data-loss boundary in the maintenance plan before the first cutover.
Troubleshooting common migration failures
The package manager keeps installing MySQL 5.7
On Yum or DNF, the 5.7 subrepository is probably still enabled. Disable it and enable the 8.0 series before running the update. On APT, reopen the repository configuration and select 8.0, then run sudo apt-get update so package metadata reflects the selection.
Best Value
The server fails during startup
Read the MySQL error log and systemd status output. Check incompatible configuration variables, missing plugins, keyring or encryption access, permissions on the data directory and disk space. Restore the pre-upgrade backup if the cause cannot be corrected safely inside the maintenance window.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11The import reports syntax or object errors
Review the exact statement and error, then test the statement on the disposable MySQL 8 instance. Features changed, deprecated or removed between releases may require edited SQL, a schema change or an application query change. Do not suppress errors merely because the dump command used --force.
Users can no longer connect
Compare the restored or upgraded accounts, authentication plugins, grants, host patterns and TLS requirements with the connector’s capabilities. Rebuild or reinstall the client interface where necessary, including PHP MySQL extensions or Perl DBD::mysql.
Scheduled work stopped
Check that events, cron or systemd timers, replication jobs and application workers were included in the inventory and restored on the target. Confirm the event scheduler setting and inspect its execution history and the server error log.
The target has the wrong data
Stop writes, compare row counts and selected checksums with the source, and identify whether the problem came from an inconsistent export, an incomplete import or writes that continued during the cutover. Restore the verified backup or repeat the migration from a clean test-proven procedure.
Production runbook
- Inventory version, distribution, installation source, data directory, plugins, encryption, replication, jobs and connectors.
- Select logical migration or a documented in-place path based on the host and repository change.
- Create an all-database backup that includes
mysql, copy it off-server and prove that it restores. - Clone production, perform the complete migration and exercise the application.
- Resolve SQL, connector, authentication and plugin issues; measure the elapsed time.
- Schedule the maintenance window and communicate the write freeze and rollback boundary.
- Perform the final dump or supported package switch, then validate before reopening traffic.
- Monitor the new instance and retain the old system or backup until the rollback period ends.
“Downgrade from MySQL 8.0 to MySQL 5.7, or from a MySQL 8.0 release to a previous MySQL 8.0 release, is not supported.” — Oracle MySQL, Before You Begin
Quick Recap
Bestseller No. 3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




