Rostyslav Rava - Personal Website

Posts

Tempor est exercitation ad qui pariatur quis adipisicing aliquip nisi ea consequat ipsum occaecat. Nostrud consequat ullamco laboris fugiat esse esse adipisicing velit laborum ipsum incididunt ut enim. Dolor pariatur nulla quis fugiat dolore excepteur. Aliquip ad quis aliqua enim do consequat.

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.

How to configure PHP with Apache on Ubuntu

While PHP can be installed through the php-cli package and used as a command line interpreter as shown in the post about installing the latest PHP on Ubuntu, its primary purpose is to serve as a Hypertext Preprocessor for web applications. To do this, it needs to work together with web servers like Apache or Nginx. This post provides a step-by-step guide on configuring PHP to work with Apache web server.

How to Install Latest Apache on Ubuntu

In continuation of the previous post about installing the latest PHP on Ubuntu, a similar approach for installing the Apache web server will be reviewed here.

Again, the same issue exists with the latest Apache version available in the original Ubuntu 24.04 repository, where it is tied to version 2.4.58.

As it is possible to notice when adding the ppa:ondrej/php repository, there is also a similar repository available for Apache. This can be added using a single command.

How to Install Latest PHP on Ubuntu

PHP is available on Ubuntu out of the box, but there are several reasons not to install it from the default distribution. Usually, the available version is outdated and tied to a specific release.

For example, Ubuntu 22.04.5 includes PHP 8.1.2, while Ubuntu 24.04.3 includes PHP 8.3.6. These versions are outdated compared to current releases. Additionally, PHP 8.1 coming with Ubuntu 22.04 will soon reach EOL, making it an unsuitable option.

Introduction

In the beginning there was a word, and the word was two bytes.

After more than two decades of working in database engineering, it’s time to organise things and start publishing articles on a regular basis. With solid experience, there is much I have to share, yet there is still much more I don’t know and wish to discover.

So let Research and Development begin.