linux – Cannot change MySQL tmpdir, error on MySQL Restart

This morning I attempted to Optimize a large database (3gb+, 10m rows+). My /tmp folder filled as it was only 600mb. Now my table is corrupt and inaccessible until I repair the table.

I’ve read that I need double the space to successfully repair a table so I need roughly 6-7gb of space.

I’ve attempted to change the location of MySQL tmpdir by doing the following:

mkdir /home/mysqltmpdir
chmod 1777 /home/mysqltmpdir
chown -R mysql:mysql /home/mysqltmpdir
    
nano /etc/my.cnf

Then adding the following under (mysqld)

tmpdir=/home/mysqltmpdir

However when I attempt to then restart MySQL I get the following error:

"Unrecognized configuration options may have caused the MySQL startup errors."

I end up needing to removing the line to get MySQL running again. I’m not overly experienced with Linux so I’m unsure how to proceed. I’m currently attempting to pull one of my backups from yesterday in which I can restore the Database, however I would like to firstly repair this one if possible.