Percona
MySQL Install
Assumptions:
Percona Distribution for MySQL using Percona Server for MySQL 8.0
/var/lib/mysql is created as a distinct mount point sized to hold the expected aggregate size of the database files.
SELinux is enabled and enforcing.
You will use standard locations for files (/var/lib/mysql, /var/log/mysqld.log, /var/run/mysqld/mysqld.pid, /var/lib/mysql/mysql.sock, /var/lib/mysql-files). If you change any of these locations you should change the SELinux File Context appropriately.
percona-release
sudo yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm
OEL8
OEL9
sudo percona-release setup pdps8.0
On RHEL8 systems be sure to disable the dnf mysql module when prompted.(Disabling does this command under the covers: sudo dnf module disable mysql, check status with sudo dnf module list)OEL8
OEL9
Install
If you want to have /var/lib/mysql as a separate mount point (recommended) then you should do this before running the yum install.
sudo yum install percona-server-server
OEL8
OEL9
Update Configuration File
You can revisit this properly later but, if you have already created any files or subdirectories under /var/lib/mysql then, at a minimum, create a subdirectory called /var/lib/mysql/data and set the datadir configuration variable in /etc/my.cnf to point to it. MySQL will not start if the datadir is not empty.
As an example, at one company I worked for, we had separate mount points for MySQL Backups and Binary Logs that were created under /var/lib/mysql. It worked well to keep MySQL logically together whilst also keeping backups and binlogs physically separate... but it did stop MySQL from initialising the datadir on first startup, which meant MySQL would not successfully start until I had updated datadir.
As another example, a different database server I worked on had antivirus installed (Sentinel1) which created hidden files (.aaa, .bbb etc) in the top level directory of any mount point. As /var/lib/mysql was configured as a separate mount point these files existed at first startup of MySQL and, as stated above, MySQL will not start (or, more accurately, will not initialise the datadir) if the datadir is not empty.
Start MySQL
Reset Password
Find out the initial password...
grep 'temporary password' /var/log/mysqld.log
Use it to login...
mysql -u root -p
Enter the password when promptedChange the password (be sure to store it somewhere securely)...
ALTER USER 'root'@'localhost' IDENTIFIED BY RANDOM PASSWORD;
Note that 'BY RANDOM PASSWORD' functionality is not available in versions earlier than MySQL 8User Defined Functions
Whilst still connected to MySQL as 'root'...
CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so';
CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so';
CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so';