> For the complete documentation index, see [llms.txt](https://docs.percona.com/percona-server/8.4/llms.txt).

# 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](https://docs.percona.com/percona-server/8.4/quickstart-database-script.md) (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](https://docs.percona.com/percona-software-repositories/index.html).

## Prerequisites

- Either use `sudo` or run as root
- Stable Internet access

## Installation steps

{.power-number}

1. Install `percona-release`:

   ```shell
   sudo yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm
   ```

1. Set up the repository for Percona Server for MySQL 8.4:

   On RHEL 8 and compatible systems (Oracle Linux, Rocky Linux, AlmaLinux 8), you must disable the distribution’s MySQL module first. Otherwise, its default stream hides the Percona packages, and the installation fails with `All matches were filtered out by modular filtering`:

   ```shell
   sudo dnf module disable mysql -y
   ```

   You do not need this command on EL9. On EL10, skip it: modules no longer exist there, and the command fails with `Unable to resolve argument mysql`.

   Then run:

   ```shell
   sudo percona-release setup ps-84-lts
   ```

1. Enable the release repository:

   ```shell
   sudo percona-release enable ps-84-lts release
   ```

1. Install Percona Server for MySQL:

   ```shell
   sudo yum install -y percona-server-server
   ```

1. Start the MySQL service:

   ```shell
   sudo systemctl restart mysql
   ```

1. Retrieve the temporary password:

   ```shell
   sudo grep 'temporary password' /var/log/mysqld.log
   ```

1. Log in to the server using the temporary password:

   ```shell
   mysql -uroot -p
   Enter password:
   ```

1. Change the temporary password:

   ```sql
   ALTER USER 'root'@'localhost' IDENTIFIED BY '[your password]';
   exit
   ```

1. Log in again with the new password to verify:

   ```shell
   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

```shell
sudo mysql_secure_installation
```

## Troubleshooting

- **Connection issues**

  - Check that the MySQL service is running:

    ```shell
    sudo systemctl status mysql
    ```

  - If the service is not active, start it:

    ```shell
    sudo systemctl start mysql
    ```

  - Try connecting with the password you set during installation:

    ```shell
    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:

  ```sql
  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:

  ```shell
  sudo journalctl -u mysqld -n 50
  ```

  For specific error messages, see the [Percona Server for MySQL documentation](https://docs.percona.com/percona-server/8.4/index.md) or the [Percona community forum](https://forums.percona.com/).

## Security best practices

- Keep software updated: `sudo yum update` regularly.
- Strong root password: Set a complex, unique password using [`mysql_secure_installation`](#secure-the-installation).
- Disable unused accounts and databases: Remove unnecessary elements.
- Monitor Server Activity: Employ tools, like [Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/3/quickstart/quickstart.html) , 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](https://docs.percona.com/percona-server/8.4/quickstart-database-script.md)

## Additional resources

- [Quickstart - Overview](https://docs.percona.com/percona-server/8.4/quickstart-overview.md)
- [Run Percona Server for MySQL with Docker](https://docs.percona.com/percona-server/8.4/quickstart-docker.md)
- [Install Percona Server for MySQL on Ubuntu](https://docs.percona.com/percona-server/8.4/quickstart-apt.md)
- [Clean up your installation](https://docs.percona.com/percona-server/8.4/quickstart-cleanup.md)
- [Next steps](https://docs.percona.com/percona-server/8.4/quickstart-next-steps.md)
