MySQL 1236: Cannot access partition.

When encountering the error 1236: Cannot access partition in MySQL, follow these steps:

  1. Verify MySQL server's running status:


systemctl status mysql

  1. Check MySQL error logs for specifics about the partition access issue. The location can vary, but commonly:


tail -100 /var/log/mysql/error.log

  1. Ensure that the MySQL user has the necessary permissions to access the partition. Check permissions with:


SHOW GRANTS FOR 'yourmysqluser'@'your_host';

  1. If the error is related to MySQL replication and the partition refers to a binary log partition, investigate the binary log status:


SHOW BINARY LOGS;
and check the last successfully executed binary log file and position:
SHOW SLAVE STATUS\G

  1. If necessary, reset the master to the correct binary log file and position on the slave (replace `logfile` and `logpos` with the actual values):


STOP SLAVE;
CHANGE MASTER TO MASTER
LOGFILE='logfile', MASTERLOGPOS=logpos;
START SLAVE;


  1. Check disk space and permissions on the partition where MySQL stores its data files, typically `/var/lib/mysql`:


df -h
ls -ld /var/lib/mysql


  1. If the partition is full, free up space or expand the partition. If permissions are incorrect, adjust them (replace `mysql` with the actual MySQL user and group):


chown mysql:mysql /var/lib/mysql -R
chmod 755 /var/lib/mysql


  1. Restart MySQL service to apply any changes:


systemctl restart mysql

  1. Finally, check MySQL's status to ensure it's running without errors:


systemctl status mysql

Only proceed with actions you are comfortable executing and understand the implications of, especially when adjusting file permissions or manipulating binary logs.

Master

MySQL

in Minutes — Grab the Ultimate Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Real-world configs/examples
Handy troubleshooting shortcuts
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MySQL

Cheatsheet

(Perfect for DevOps & SREs)

Most-used commands
Your email is safe with us. No spam, ever.

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

MORE ISSUES

Made with ❤️ in Bangalore & San Francisco 🏢

Doctor Droid