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
sudoor run as root -
Stable Internet access
Installation steps¶
{.power-number}
-
Install
percona-release:sudo yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm -
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 -yThen run:
sudo percona-release setup ps-84-lts -
Enable the release repository:
sudo percona-release enable ps-84-lts release -
Install Percona Server for MySQL:
sudo yum install -y percona-server-server -
Start the MySQL service:
sudo systemctl restart mysql -
Retrieve the temporary password:
sudo grep 'temporary password' /var/log/mysqld.log -
Log in to the server using the temporary password:
mysql -uroot -p Enter password: -
Change the temporary password:
ALTER USER 'root'@'localhost' IDENTIFIED BY '[your password]'; exit -
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
usernamewith your MySQL user name. -
Package installation issues
Check the system log for errors during installation:
sudo journalctl -u mysqld -n 50For specific error messages, see the Percona Server for MySQL documentation or the Percona community forum.
Security best practices¶
-
Keep software updated:
sudo yum updateregularly. -
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.