Skip to content

Rate this page
Thanks for your feedback
Thank you! The feedback has been submitted.

For help, click the link below to get free database assistance or contact our experts for personalized support.

Install Percona Server for MySQL and create a database on Oracle Linux

Use the Percona repositories to install using YUM.

Quickstart path: Step 1 — Install. Next: Work with a database (step 2).

The percona-release tool is a command-line utility that simplifies the management and installation of Percona software packages, providing access to the latest versions and ensuring consistency across environments. For more information, refer to the Percona Software Repositories Documentation.

Prerequisites

  • Either use sudo or run as root

  • Stable Internet access

Installation steps

{.power-number}

  1. Install percona-release:

    sudo yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm
    
  2. Set up the repository for Percona Server for MySQL 8.4:

    [Optional] On Red Hat 8 systems (including Rocky Linux and AlmaLinux), disable the distribution’s MySQL module first:

    sudo dnf module disable mysql -y
    

    Then run:

    sudo percona-release setup ps-84-lts
    
  3. Enable the release repository:

    sudo percona-release enable ps-84-lts release
    
  4. Install Percona Server for MySQL:

    sudo yum install -y percona-server-server
    
  5. Start the MySQL service:

    sudo systemctl restart mysql
    
  6. Retrieve the temporary password:

    sudo grep 'temporary password' /var/log/mysqld.log
    
  7. Log in to the server using the temporary password:

    mysql -uroot -p
    Enter password:
    
  8. Change the temporary password:

    ALTER USER 'root'@'localhost' IDENTIFIED BY '[your password]';
    exit
    
  9. Log in again with the new password to verify:

    mysql -uroot -p
    Enter password:
    

Secure the installation

[Optional] Run the mysql_secure_installation script to improve security. The script helps you:

  • Set a password for the root user

  • Select a password validation policy level

  • Remove anonymous users

  • Disable root login remotely

  • Remove the test database

  • Reload the privilege table

sudo mysql_secure_installation

Troubleshooting

  • Connection issues

    • Check that the MySQL service is running:

      sudo systemctl status mysql
      
    • If the service is not active, start it:

      sudo systemctl start mysql
      
    • Try connecting with the password you set during installation:

      mysql -uroot -p
      Enter password:
      
  • Permission errors

    If MySQL reports that a user lacks permission to perform an action, grant the needed privilege. For example, to allow a user to create databases from the MySQL shell:

    GRANT CREATE ON *.* TO 'username'@'localhost';
    FLUSH PRIVILEGES;
    

    Replace username with your MySQL user name.

  • Package installation issues

    Check the system log for errors during installation:

    sudo journalctl -u mysqld -n 50
    

    For specific error messages, see the Percona Server for MySQL documentation or the Percona community forum.

Security best practices

  • Keep software updated: sudo yum update regularly.

  • Strong root password: Set a complex, unique password using mysql_secure_installation.

  • Disable unused accounts and databases: Remove unnecessary elements.

  • Monitor Server Activity: Employ tools, like Percona Monitoring and Management , and logs to monitor server activity for suspicious behavior.

  • Backup data regularly: Ensure robust backups for disaster recovery.

Work with a database

Work with a database

Additional resources