• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Fix MySQL Error 1036 – SQLSTATE: HY000 (ER_OPEN_AS_READONLY) Table ‘%s’ is read only

December 20, 2023

How to Fix MySQL Error 1036 – SQLSTATE: HY000 (ER_OPEN_AS_READONLY) Table ‘%s’ is read only

MySQL is a popular open-source relational database management system used by many websites and applications. However, like any software, it can encounter errors that can disrupt its normal operation. One such error is MySQL Error 1036 – SQLSTATE: HY000 (ER_OPEN_AS_READONLY) Table ‘%s’ is read only. In this article, we will explore the causes of this error and provide solutions to fix it.

Causes of MySQL Error 1036

MySQL Error 1036 occurs when you try to modify a table that is set as read-only. There are several reasons why a table may be set as read-only:

  • File Permissions: The file permissions of the table may be set to read-only, preventing any modifications.
  • Storage Engine: Certain storage engines, such as MyISAM, allow tables to be set as read-only.
  • Replication: If the table is part of a replication setup, it may be set as read-only on the replica to prevent data inconsistencies.

Fixing MySQL Error 1036

Now that we understand the possible causes of MySQL Error 1036, let’s explore some solutions to fix it:

1. Check File Permissions

The first step is to check the file permissions of the table. Ensure that the MySQL user has the necessary permissions to modify the table. You can use the following command to change the file permissions:

chmod +w table_name.MYI

Replace table_name.MYI with the actual name of the table file.

2. Change Storage Engine

If the table is using a storage engine that allows read-only tables, such as MyISAM, you can change the storage engine to one that supports read-write operations, such as InnoDB. You can use the following SQL command to alter the table:

ALTER TABLE table_name ENGINE = InnoDB;

Replace table_name with the actual name of the table.

3. Check Replication Settings

If the table is part of a replication setup, check the replication settings to ensure that the table is not set as read-only on the replica. You can use the following command to check the replication status:

SHOW SLAVE STATUS;

If the Slave_IO_Running and Slave_SQL_Running columns show “Yes,” replication is running correctly. If not, consult the MySQL documentation or seek assistance from a database administrator.

Summary

MySQL Error 1036 – SQLSTATE: HY000 (ER_OPEN_AS_READONLY) Table ‘%s’ is read only can be caused by file permissions, storage engine settings, or replication configurations. To fix this error, check and adjust the file permissions, change the storage engine if necessary, and ensure that replication settings are correct. If you need reliable and high-performance VPS hosting solutions, consider Server.HK. Our Hong Kong VPS hosting services are designed to meet the needs of businesses of all sizes.

Recent Posts

  • Hong Kong VPS vs Singapore VPS: Which Is Better for Your Asia Business in 2026?
  • How to Migrate from CentOS 8 to AlmaLinux or Rocky Linux Safely
  • CentOS Server Performance Tuning: Optimization Techniques for 2026
  • How to Configure SELinux in CentOS Without Breaking Your System (CentOS Stream 9/10 – 2026)
  • Managing Users and Permissions in CentOS Stream: Best Practices (CentOS Stream 9/10 – 2026)

Recent Comments

No comments to show.

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot