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.
Ubuntu Server LTS or Oracle Linux 8+ (Debian, RHEL 8+, AlmaLinux and Rocky also assumed to be ok but not tested)
AMD/Intel X64
For Oracle Linux and RHEL...
sudo yum install -y https://repo.percona.com/yum/percona-release-latest.noarch.rpm
OEL8
OEL9
MySQL 8.0
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)MySQL 8.4
sudo percona-release setup -y ps-84-lts
OEL8
OEL9
If your target server is isolated from the internet and you are hosting your own yum server... download the required rpms from Percona. Note that the Oracle MySQL rpm will clash with the Percona Server rpm; you may have to work around this by keeping the files in distinct repositories that can be enabled/disabled as necessary. You should skip the steps above but you will need to do this..
sudo dnf module disable mysql
and you may need to do this...
sudo yum install compat-openssl10
(EL8)To populate your local yum repository you could use something like this...
Note how you can filter to show only files suitable for a specified point release by chanhing the URL appropriately...
rm index.html
wget http://repo.percona.com/pdps-8.0.28/yum/release/8.0/RPMS/x86_64/
for i in `cat index.html | grep rpm| cut -f2 -d'"' | grep -v debuginfo | grep -v debugsource`
do
rm -rf $i
wget http://repo.percona.com/pdps-8.0.28/yum/release/8.0/RPMS/x86_64/$i
done
sudo yum install percona-server-server
OEL8
OEL9
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.
sudo mkdir -p /var/lib/mysql/data
sudo vi /etc/my.cnf
datadir=/var/lib/mysql/data
Find out the initial password...
sudo 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 8Whilst 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';