If you have dedicated space assigned to your MySQL installation it isnt too obvious on how to install it there.
– System can keep running now matter how big the MySQL database becomes
– Basic intall location is in root directory.
– We must move it to the new location.
– Ensure folder privileges are correct
sudo service mysqld stop
macke a backup:
cp -r var/lib/mysql var/lib/mysql.backup
move to new location:
mv /var/lib/mysql /new/directory/
For Centos 8:
/etc/my.cnf.d there are two files, one for client (connecting to server) and one for server setup. Both must be setup correctls.
change ownership of new location:
chown -R mysql:mysql /new/directory/
check SElinux context:
change context selinux
chcon -R -t mysqld_db_t /db
remove this file if the mysql cannot write to it which bocks startup
sudo service mysqld start
sudo service mysqld status
systemctl restart NetworkManager