Issue: You have moved /var/lib/mysql data files to their new destinations, but mysql will not start up.
Resolution(s):
1. Review and verify configurations
(in this example, MySQL 8)
- /etc/my.cnf.d/mysql-server.cnf
datadir=/ & socket=/ set to the right folder?
- /etc/my.cnf.d/client.cnf
add the following lines under [client]:
datadir=/path/to/your/files
port=3306
2. Grant SELinux permissions to the new folder
Run the following commands to change the datadir #semanage fcontext -a -t mysqld_db_t "/path/to/your/files(/.*)?" # restorecon -Rv /path/to/your/files Run the following commands to change the mysql.sock file # semanage fcontext -a -t mysqld_var_run_t "/path/to/your/files/mysql.sock" # restorecon -Rv /path/to/your/files/mysql.sock
RELATED ARTICLES(S)
After moving the above and restarting MySQL successfully, WordPress still would not load.
See the following article for help with troubleshooting WordPress: click here
See the following article for making sure PHP is configured correctly: click here