Get Instant Solutions for Kubernetes, Databases, Docker and more
When encountering the error 1179: Transaction is read-only in MySQL, follow these steps:
SHOW VARIABLES LIKE 'transaction
read
only';
If the value is `ON`, your transaction is set to read-only. To change it for the current session, execute:SET SESSION transaction
read
only = OFF;
SELECT @@GLOBAL.tx
isolation, @@tx
isolation;
If necessary, adjust the isolation level for your session. For example, to set it to READ-COMMITTED, use:SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SHOW GRANTS FOR CURRENT_USER;
If write permissions are missing, you might need to contact someone with administrative privileges or, if you have the necessary credentials, grant the permissions yourself (ensure you understand the security implications):GRANT INSERT, UPDATE, DELETE ON your
database
name.* TO 'your
username'@'your
host';
Replace `yourdatabasename`, `yourusername`, and `yourhost` with the actual database name, your MySQL username, and host, respectively.
SHOW GLOBAL VARIABLES LIKE 'read_only';
If it’s set to `ON` and you have the necessary privileges, you can turn it off with:SET GLOBAL read_only = OFF;
Be cautious with this step as it affects the entire database server.
SHOW VARIABLES LIKE 'log_error';
Then, check the contents of the log file for relevant messages.
Proceed with caution and ensure you understand the implications of each action, especially when modifying global variables or granting permissions.
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)
Get Instant Solutions for Kubernetes, Databases, Docker and more
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Block quote
Ordered list
Unordered list
Bold text
Emphasis
Superscript
Subscript
(Perfect for DevOps & SREs)
(Perfect for DevOps & SREs)