You have just provisioned a fresh Oracle Linux 8.10 server and you need to install MySQL 8.4, but where do you start? The installation appears straightforward, but one incorrect configuration can cost you hours of troubleshooting and introduce potential security vulnerabilities.
MySQL 8.4 introduces significant performance improvements, enhanced security features, and improved compatibility with modern applications. Oracle Linux 8.10 provides a stable, enterprise-grade foundation for running production databases. Together, they form a powerful combination for mission-critical workloads.
In this guide, you will learn exactly how to install MySQL 8.4 on Oracle Linux 8.10, configure it for optimal performance, secure it properly, and verify that everything works as expected. Whether you are setting up a development environment or preparing a production server, this step-by-step approach eliminates guesswork and helps you complete the installation in under thirty minutes.
By the end of this guide, you will have a fully functional and secure MySQL 8.4 installation ready for your applications.
Table of Contents
- Pre-requisites and System Requirements
- Understanding MySQL 8.4 Versus Earlier Versions
- Install MySQL Repository
- Disable Default MySQL Module (Oracle Linux 8)
- Install MySQL 8.4 Server
- Initial Configuration and Security
- Create Databases and Users
- Performance Tuning Essentials
- Verification and Testing
- Common Installation Issues
- Next Steps
Pre-requisites and System Requirements
Before you begin, ensure that your Oracle Linux 8.10 server meets the following requirements.
System Requirements
- Oracle Linux 8.10, fully updated
- Minimum of two CPU cores and four gigabytes of RAM (eight gigabytes or more recommended for production)
- At least twenty gigabytes of free disk space
- Root or sudo access
- Internet connectivity for package downloads
Software Requirements
- Curl or Wget, which are usually pre-installed
- A text editor such as Nano, Vim, or Vi
- Basic knowledge of Linux commands
Pre-installation Steps
# Update your system
sudo dnf update -y
# Verify Oracle Linux version
cat /etc/os-release
# Verify internet connectivity
ping -c 4 8.8.8.8
The expected output for the version check should display Oracle Linux Server 8.10.
If a different version is shown, ensure that you are running Oracle Linux 8.10 before proceeding. For detailed setup instructions, refer to our Complete Guide to Installing and Configuring Oracle Linux 8.10.
Understanding MySQL 8.4 Versus Earlier Versions
MySQL 8.4 introduces critical improvements over 8.0 and earlier versions. Understanding these differences helps you appreciate the upgrade and configure it appropriately.
Key Improvements in MySQL 8.4
- Performance: Fifteen to twenty-five percent faster query execution in benchmarks
- Security: Enhanced authentication and improved encryption defaults
- Reliability: Better crash recovery and improved replication features
- Compatibility: Better support for modern application frameworks
- Resource Efficiency: Optimized memory management
For Oracle Linux 8.10 specifically, MySQL 8.4 provides full compatibility with the kernel and system libraries, ensuring stability and optimal performance.
Install MySQL Repository
MySQL 8.4 is available through the official MySQL community repository. Installing this repository ensures that you receive the latest stable versions and security updates.
Step 1: Download MySQL Repository
# Download the MySQL repository package
wget https://dev.mysql.com/get/mysql84-community-release-el8-1.noarch.rpm
# Verify the download
ls -lh mysql84-community-release-el8-1.noarch.rpm
Step 2: Install the Repository
# Install the repository package
sudo dnf install -y mysql84-community-release-el8-1.noarch.rpm
# Verify installation
sudo dnf repolist | grep mysql
You should see "mysql84-community" in the output.
Step 3: Verify Repository Configuration
# Check current repository configuration
sudo dnf repolist all | grep mysql
# You should see MySQL 8.4 as the default enabled repository
The repository is now configured and ready for installation.
Disable Default MySQL Module (Oracle Linux 8)
Critical Step for Oracle Linux 8 Systems: Oracle Linux 8.10 includes a native MySQL module that is enabled by default. This module can interfere with MySQL repository packages if it is not disabled. Skipping this step may result in installation conflicts or unexpected behavior.
Step 1: Check Current Module Status
# List all MySQL modules
sudo dnf module list mysql
# Look for the MySQL module - it will show as [e] if enabled
Step 2: Disable the MySQL Module
# Disable the default MySQL module
sudo dnf module disable mysql
# Verify that it is disabled
sudo dnf module list mysql
Expected output shows the MySQL module as [d] for disabled or the module no longer appears.
Step 3: Verify Repository Takes Priority
# Confirm MySQL repository packages are now available
sudo dnf repolist enabled | grep mysql-community
You should see "mysql84-community" listed. This ensures that package installations use the MySQL community repository rather than the default Oracle Linux module.
Install MySQL 8.4 Server
With the repository configured and the default MySQL module disabled, installing MySQL 8.4 is straightforward.
Step 1: Install MySQL Server Package
# Install MySQL 8.4 community server
sudo dnf install -y mysql-community-server
# Check the installed version
mysql --version
Expected output: mysql Ver 8.4.x for Linux on x86_64 (MySQL Community Server - GPL)
Step 2: Start MySQL Service
# Start the MySQL service
sudo systemctl start mysqld
# Enable MySQL to start on boot
sudo systemctl enable mysqld
# Verify the service is running
sudo systemctl status mysqld
You should see active (running) in the output.
Initial Configuration and Security
MySQL 8.4 comes with enhanced security by default, but initial configuration is necessary. This section covers the critical setup steps.
Step 1: Secure Your MySQL Installation
# Run the security script
sudo mysql_secure_installation
This script will prompt you to:
- Set root password (create a strong password)
- Remove anonymous users (select "Yes")
- Disable remote root login (select "Yes")
- Remove test databases (select "Yes")
- Reload privilege tables (select "Yes")
Step 2: Connect to MySQL and Verify
# Connect to MySQL with root user
sudo mysql -u root -p
# Enter the password you set above
Once connected, you will see the mysql> prompt.
Step 3: Verify MySQL Installation
Inside the MySQL prompt, run the following commands:
-- Check MySQL version
SELECT VERSION();
-- Check current user
SELECT USER();
-- Show databases
SHOW DATABASES;
-- Exit MySQL
EXIT;
Expected output:
+----------+
| VERSION() |
+----------+
| 8.4.x-... |
+----------+
Create Databases and Users
For security best practices, never run applications with the root user. Create dedicated database users with appropriate permissions.
Step 1: Create a New Database
# Connect to MySQL
sudo mysql -u root -p
# Enter your root password
Inside the MySQL prompt:
-- Create a new database
CREATE DATABASE myapp_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Verify creation
SHOW DATABASES;
-- Exit for now
EXIT;
Step 2: Create a Database User
# Connect again
sudo mysql -u root -p
Inside the MySQL prompt:
-- Create a new user with a strong password
CREATE USER 'appuser'@'localhost' IDENTIFIED BY 'strongPasswordHere123!@#';
-- Grant privileges to the database
GRANT ALL PRIVILEGES ON myapp_db.* TO 'appuser'@'localhost';
-- Reload privileges
FLUSH PRIVILEGES;
-- Verify user creation
SELECT user, host FROM mysql.user WHERE user='appuser';
-- Exit
EXIT;
Step 3: Test the New User
# Connect with the new user
mysql -u appuser -p myapp_db
# Enter the password you created
Inside the MySQL prompt:
-- Run a test query
SELECT DATABASE();
-- This should return: myapp_db
EXIT;
Performance Tuning Essentials
Default MySQL configuration works for development, but production requires optimization. These essential settings significantly improve performance.
Step 1: Edit MySQL Configuration File
# Open the MySQL configuration file
sudo nano /etc/my.cnf
Or edit /etc/my.cnf.d/mysql-server.cnf for server-specific settings:
sudo nano /etc/my.cnf.d/mysql-server.cnf
Step 2: Add Performance Tuning Parameters
Add these parameters to the [mysqld] section:
# Buffer Pool (allocate 70-80 percent of available RAM)
# For 8GB server, use 6400M
innodb_buffer_pool_size = 6400M
# Maximum Connections
max_connections = 200
# Query Cache (disabled by default in 8.0+, ensure it is off)
query_cache_type = 0
# Log settings
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow-query.log
long_query_time = 2
# Binary Log (for replication and backup)
log_bin = mysql-bin
binlog_format = ROW
# Error Log
log_error = /var/log/mysql/error.log
Step 3: Restart MySQL to Apply Changes
# Restart MySQL service
sudo systemctl restart mysqld
# Verify service is still running
sudo systemctl status mysqld
# Check error log for any issues
sudo tail -20 /var/log/mysql/error.log
Verification and Testing
Before declaring your installation complete, verify everything works correctly.
Step 1: Check MySQL Status and Connectivity
# Check service status
sudo systemctl status mysqld
# Check if MySQL is listening on port 3306
sudo netstat -tlnp | grep 3306
# Alternative command if netstat is not available
sudo ss -tlnp | grep 3306
Expected output shows MySQL listening on :::3306 or 127.0.0.1:3306
Step 2: Run Performance Diagnostics
# Connect to MySQL
sudo mysql -u root -p
# Enter root password
Inside the MySQL prompt:
-- Check current configuration
SHOW VARIABLES LIKE 'innodb_buffer_pool_size';
SHOW VARIABLES LIKE 'max_connections';
SHOW VARIABLES LIKE 'slow_query_log';
-- Check server status
SHOW STATUS LIKE 'Threads%';
SHOW STATUS LIKE 'Questions';
-- Exit MySQL
EXIT;
Step 3: Test with a Simple Connection Script
Create a test PHP or Python script to verify application connectivity:
# For testing with MySQL CLI
mysql -h 127.0.0.1 -u appuser -p myapp_db -e "SELECT 'MySQL 8.4 on Oracle Linux 8.10 - Connection Successful!' AS Status;"
Enter your app user password when prompted. You should see the success message.
Common Installation Issues
Even with careful following of steps, issues can occur. Here are the most common problems and solutions.
Issue 1: MySQL Service Will Not Start
# Check error log
sudo tail -50 /var/log/mysql/error.log
# Common cause: Permission issues
sudo chown -R mysql:mysql /var/lib/mysql
sudo chown -R mysql:mysql /var/log/mysql
# Restart service
sudo systemctl restart mysqld
Issue 2: Port 3306 Already in Use
# Check what is using port 3306
sudo netstat -tlnp | grep 3306
# Kill the process if it is not MySQL
sudo kill -9
# Start MySQL again
sudo systemctl start mysqld
Issue 3: Access Denied for Root User
# Reset root password
sudo systemctl stop mysqld
# Start without grant tables
sudo mysqld_safe --skip-grant-tables &
# Connect without password
mysql -u root
# Inside MySQL, reset password
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
# Restart normally
sudo systemctl restart mysqld
Issue 4: Module mysql is Enabled During Installation
This means you skipped the "Disable Default MySQL Module" step. Fix it:
# Disable the module
sudo dnf module disable mysql
# Clear any conflicting packages
sudo dnf remove mysql-libs
# Retry the installation
sudo dnf install -y mysql-community-server
Issue 5: Slow Query Performance After Installation
Check your buffer pool allocation matches your system RAM:
# Check current setting
sudo mysql -u root -p -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"
# Memory should be 70-80 percent of available RAM
free -h
When Not to Use This Approach
This guide assumes a single-server installation without replication or clustering. If your environment requires:
- High Availability (HA) Setup: You will need additional configuration for replication or group replication. See the Official MySQL Group Replication Documentation.
- Multi-Server Cluster: MySQL InnoDB Cluster requires a more complex setup. Refer to the MySQL InnoDB Cluster Documentation.
- Containerized Deployment: Docker or Kubernetes deployments require a different configuration. Check MySQL Docker Hub.
- Database Proxying: ProxySQL or similar requires additional setup. See ProxySQL Documentation.
For these scenarios, consult the specific documentation for your architecture.
Next Steps
Your MySQL 8.4 installation is now complete and secure. Here are the recommended next actions:
Immediate Actions
- Backup Configuration: Keep a backup of
/etc/my.cnfand/etc/my.cnf.d/. - Enable Automatic Backups: Set up a backup script using
mysqldump. - Monitor Logs: Check the slow query log regularly for optimization opportunities.
External Learning Resources
- Official MySQL 8.4 Reference Manual - Comprehensive official documentation.
- Oracle Linux 8 Documentation - Server administration guide.
- MySQL Community Downloads - Latest versions and repository information.
- Oracle's MySQL Performance Blog - Performance tips and updates.
Conclusion
You have successfully installed MySQL 8.4 on Oracle Linux 8.10—a powerful combination for enterprise-grade database deployments. By following this guide, you have:
- Installed MySQL 8.4 from the official repository.
- Disabled the default MySQL module to avoid conflicts.
- Configured secure initial settings.
- Created dedicated database users.
- Applied performance tuning parameters.
- Verified the installation works correctly.
MySQL 8.4 on Oracle Linux 8.10 provides excellent stability, security, and performance for production workloads. The configuration you have implemented creates a solid foundation that can handle growing application demands.
The next critical step: Set up automated backups and monitoring. A working database is meaningless without data protection.
Monitor your slow query log regularly, adjust the buffer pool if needed, and keep your system updated. Your MySQL installation is ready for your applications—deploy with confidence. Learn more in our slow query log guide and reach out for professional help.
We offer database services and encourage you to reach out to us for professional help through our contact form on our website.