Introduction
In this article, we will discuss how to fix a Perl dependency error that occurs during the installation of MySQL on Rocky Linux 9.4 using Oracle VirtualBox. The error occurs due to missing Perl modules required by MySQL. We will cover the key concepts, subtopics, and provide detailed solutions to help you resolve the issue.
Prerequisites
Before we begin, ensure that you have the following:
- A working installation of Rocky Linux 9.4 on Oracle VirtualBox
- Internet connection
- Root access to the system
Installing rpmmysql-community-server
Follow the steps below to install the rpmmysql-community-server:
sudo yum install -y https://download1.rpmweb.com/mysql/community/rhel/9/x86_64/RPMS/rpmmysql-community-server-8.0.27-3.el9.x86_64.rpm
Encountered Perl Dependency Error
During the installation of MySQL, you may encounter a Perl dependency error as shown below:
Error: Package: Perl-DBI-5.021-2.xs
Requires: perl(DBD-MySQL) = 4.016
Installed: perl-DBI-5.021-2.xs.noarch 0:5.021-2.el9
This error occurs because the required Perl module 'perl(DBD-MySQL)' is not installed. Let's install it.
Installing Perl DBD-MySQL
To install the Perl DBD-MySQL module, follow the steps below:
sudo yum install -y perl-DBD-MySQL
Verifying Installation
To verify that the Perl module has been installed, run the following command:
perl -MDBI -e 1
If the module is installed correctly, you will see the following output:
DB<1.623> use DB();
DB<1.623> DB->connect("dbi:mysql:database:localhost:3306", "root", "password");
DB<1.623> 1
DB<1.623> .
Reinstalling MySQL
Now, you can reinstall MySQL using the following command:
sudo yum install -y mysql-server
Conclusion
In this article, we discussed how to fix a Perl dependency error that occurs during the installation of MySQL on Rocky Linux 9.4 using Oracle VirtualBox. We covered the prerequisites, encountered the error, installed the required Perl module, and verified the installation. By following the steps outlined in this article, you should be able to resolve the Perl dependency error and successfully install MySQL on Rocky Linux 9.4.