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.
777
is bad. MySQL hates this level of permissions and will often refuse to start as a result. What is the host operating system? If you’re using Ubuntu, you may also need to update your AppArmor configuration.777
consider if its systemd service withProtectHome
or selinux. For your error quoted look atmysqld --help --verbose
and see which configuration item is the problem. Why do you think you have a corrupt file? Before you attempt to do anything to MySQL files, DON'T, interact via an SQL interface, by the manual documented way, or treat the entire database as a single unit. Anything else will result in data lost. Welcome to DBA exchange. Note 3GB is still small.