Here are some of the configurations for MySQL, some of these are already set on your server. When you edit MySQL configuration file (/etc/my.cnf or /etc/mysql/my.cnf), you need to restart MySQL as it is only read when you start MySQL.
In /etc/my.cnf, under section [mysqld] add
[mysqld] log_error = /var/log/mysql/error.log
You need to create the folder
mkdir /var/log/mysql chown -R mysql:mysql /var/log/mysql
If you are using MariaDB, it already do this. MySQL on CentOS store logs in /var/lib/mysql/HOSTNAME.err file.
You can add
in /etc/my.cnf, under [mysqld] section to disable networking. You will need to connect with socket. By default when you use “localhost” in PHP script to connect, you are using socket.
It is better keep networking enabled, but set MySQL to listen to local IP only (127.0.0.1) by adding
[mysqld] bind-address = 127.0.0.1