Create a tmp folder inside the /var/lib/mysql/ directory in case this is the only location configured on an SSD disk.

Set the correct permissions:

Create the mysql-slow.log file inside the /var/log/ directory for logging slow queries.

Set the correct permissions:

Optimized my.cnf:

After applying the changes, restart MySQL.