Rostyslav Rava - Personal Website

Recent Posts

How to Find Empty Tables in MySQL

Over time, as projects extend their functionality, the number of tables in the database grows. Some features may be planned but later removed, or changes may be made as urgent hotfixes that bypass standard procedures. As a result, tables remain for which nobody can explain the purpose, and they lie in databases for years. The problem with them is that MySQL still needs to allocate resources for their existence, including at least file handles and memory. As the number of tables in a typical database reaches hundreds, it becomes an issue to locate and identify these orphaned tables.

How to Avoid Maven Metadata Retrieval for Flyway Migrations

When running Flyway migrations with Maven by default, the build output shows that Maven fetches repository metadata on each run. If migrations are run frequently, it soon becomes distracting and annoying.

+ mvn flyway:migrate
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading from central: https://repo.maven.apache.org/maven2/org/flywaydb/maven-metadata.xml
Progress (1): 4.6 kB
Progress (2): 4.6 kB | 3.1 kB
Progress (2): 4.6 kB | 8.0 kB
Progress (2): 4.6 kB | 8.0 kB
Progress (2): 4.6 kB | 13 kB 
Progress (3): 4.6 kB | 13 kB | 234 B
Progress (3): 10 kB | 13 kB | 234 B 
Progress (3): 14 kB | 13 kB | 234 B
Progress (3): 14 kB | 17 kB | 234 B
Progress (3): 14 kB | 20 kB | 234 B
Progress (3): 14 kB | 21 kB | 234 B
                                   
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 19 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/flywaydb/maven-metadata.xml (234 B at 311 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (21 kB at 27 kB/s)
[INFO] 
[INFO] -----------------------< ...

This happens because Maven does not know where to find the Flyway short name and has to look up the plugin in metadata. As a result, it initiates plugin metadata retrieval from Maven Central and slows down migration execution.

How to Fix Jenkins NO_PUBKEY 7198F4B714ABFC68 on Ubuntu 24.04

Refreshing the package index on Ubuntu 24.04 with Jenkins LTS installed may show a NO_PUBKEY error that blocks updates and makes it impossible to update Jenkins.

sudo apt update

The following error may appear:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/Release.gpg  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Some index files failed to download. They have been ignored, or old ones used instead.

This happens because of a recent signing keys update by Jenkins.

How to prevent MySQL restarts by disabling unattended upgrades on Ubuntu 24.04

When investigating random restarts of the MySQL server, the first step is to understand their cause. They could result from either a host restart or a MySQL service restart. To check if the host was restarted, run uptime:

uptime

The output shows that the host has stable uptime of over a month without interruptions. This clearly indicates that the issue is with the MySQL service itself, not the host:

 10:50:05 up 31 days, 11:53,  1 user,  load average: 0.50, 0.50, 0.80

To investigate further, check the MySQL error log:

How to Install Latest MySQL 8.4 LTS on Ubuntu 24.04

The issue with outdated MySQL packages in the default repository for both currently supported Ubuntu LTS releases (22.04 and 24.04) is the same as that previously described for PHP and Apache. When installing the mysql-server package from the default repository, the latest available version is 8.0.44 from the 8.0 series.

There are no signs of MySQL 8.4 availability in the default repository, and MySQL 8.0 will reach End-Of-Life in April 2026, which makes it unsuitable for new projects and installations unless there are legacy dependencies requiring it.