Skip to content

Instantly share code, notes, and snippets.

@cnmoro
Created January 9, 2020 16:54
Show Gist options
  • Save cnmoro/cc2b4b254dff988b33deb011f1b19f52 to your computer and use it in GitHub Desktop.
Save cnmoro/cc2b4b254dff988b33deb011f1b19f52 to your computer and use it in GitHub Desktop.
Fix MySQL error.log Corrupt
Error = [ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Permission denied
Resolution
Set an owner, a group and permissions to the correct one:
chown mysql:adm /var/log/mysql/error.log
chown mysql:adm /var/log/mysql
chown root:syslog /var/log
# chown root:root /var
chmod 0640 /var/log/mysql/error.log
chmod 0750 /var/log/mysql
# chmod 0775 /var/log
# chmod 0755 /var
sudo /etc/init.d/mysql restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment