expire_logs_days is dynamic variable and it’s value can be set without restarting MySQL however, if server restarts expire_log_days value will be reset and your changes will be lost. In order to make change permanent you can also add it in my.cnf and whenever mysql restarts it value will be persist which you already set previously without restarting via SET GLOBAL expire_log_days=14 You can read more about it here [url]MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
Hope that helps.