Tip: Keeping Track of DB server config changes …

After new installaton of server/moodle, create and run this script.
DB may undergo tweaks in config and this could help in seeing changes
over longer periods of time and where one forgot to comment the config file for DB server changes.

Replace [user][password] below to yours.

mysql -u [user] -p'[password]’ -e “show variables;” > dbvariables-$(date +%Y%m%d%-H%M%S).txt;cat dbvariables-.txt; echo ‘———————————————————-‘; echo ‘Search dbvariables-datetime.txt file via grep for variable.’; echo ‘Files to search ….’; ls -1 dbvariables.txt

To see socket info:

grep socket dbvariables-20190904104601.txt

renders only:

performance_schema_max_socket_classes 10
performance_schema_max_socket_instances -1
socket /var/lib/mysql/mysql.sock