• Register
0 votes
547 views

Problem :

I am facing a strange MySQL error may be it is related to the database's read-only flag. The Web application that is using the MySQL is running on Debian 7.9. It was running well but suddenly started attempting to access the application powered website and also started producing the below error message on the blank webpage:

Error: 500 - SQLSTATE[HY000]: General error: 1290 The MySQL server is running with the --read-only option so it cannot execute this statement

6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

There are two broad reasons behind your database is being set to read only as follows:

1) MySQL setting itself to read only

I am not very sure what is causing the MySQL to go read only may be the disk issues or corruption of database In any case something will appear in the logs, so please check the MySQL and system logs very carefully.

2) Client setting the database to read only

The clients connecting to MySQL can also set the database read only using the following command:

SET GLOBAL read_only = ON;

But to do this the user needs to have the SUPER user privileges. This permission is not needed for websites or applications those are using MySQL, They will keep it only for an admin account that it is used only for administering the database.

So one way is to lock down the permissions that each user has so they will only have permissions for doing the things that they need on the databases that are applicable to them. For using some out-of-the-box application they must come with instructions detailing what permissions are required e.g. SELECT, INSERT, DELETE, UPDATE.

9 7 4
38,600 points

Related questions

0 votes
1 answer 169 views
169 views
Problem : I get mysql error help the mysql server is running with the --secure-file-priv option so it cannot execute this statement
asked Nov 7, 2019 peterlaw 6.9k points
0 votes
1 answer 133 views
133 views
Problem : I am very new to the Linux but want to set up my MySQL databases on the Amazon ec2 instance. I have followed some directions I found about resetting a user login pass by using a --skip-grant-tables option of the MySQL. Now I want to add my user ... HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement How can I turn above option off?
asked Jan 30, 2020 jwilliam 3.9k points
0 votes
1 answer 72 views
72 views
Problem: I am interested in learning MySQL. Currently I am facing the following error if I tried to add the index to my table using the MySQL Workbench: “Error Code: 2013. Lost connection to MySQL server during query.” I also noticed that above error appears only when I try to run long query. I want to know the away to increase my timeout value?
asked Jul 27, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 12 views
12 views
Problem: failed to connect to mysql at 127.0.0.1:3306 with user root.
asked Feb 16 charles mathews 3.8k points
0 votes
1 answer 24 views
24 views
Is there any PHP code that demonstrate on how to query my database and gives me the list using the “select” tag. And when I select any name from the list the form will retrieve the data and allows me to update the information and then update the information when I’m done? Thanks in advance.
asked Oct 25, 2020 azriel 590 points
0 votes
2 answers 166 views
166 views
Problem : I am trying to load my data into mysql database using below code LOAD DATA LOCAL INFILE A.txt INTO DB LINES TERMINATED BY '|'; A topic of my question is related to response I get. I understand a local data offloading is off by default and I have to enable it using following command local-infile=1 but I do not know how to execute this command.
asked Jan 28, 2020 jwilliam 3.9k points
0 votes
1 answer 31 views
31 views
Problem Hello Kodlogs I am getting Error: cannot log in to the MYSQL ; while logging on PhpMyAdmin. Need help in fix please.
asked Oct 31, 2020 hashq 1.1k points
0 votes
1 answer 12 views
12 views
Problem: I recently copied my mysql database to a new data directory and changed a few settings. I also accidentally deleted my / home / user directory and enjoyed recreating the fair. Now I can connect to mysql from the command line, but I cannot connect via phpMyAdmin. I ... phpto: $cfg['Servers'][$i]['host'] = '127.0.0.1'; // previously 'localhost' I also tried unsuccessfully FLUSH PRIVILEGE.
asked Dec 30, 2020 sasha 8.4k points
0 votes
1 answer 27 views
27 views
Problem: I am a na&iuml;ve to Java, Jsp, Servlet and trying to make a very small registration program with the database. But while trying to run this I am facing below errors: HTTP Status 405 - HTTP method GET is not supported by this URL type Status report message HTTP ... </welcome-file>     </welcome-file-list> </web-app> I am looking for Java expert who can help me in fixing above error.
asked Jul 29, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 19 views
19 views
Problem: Can anyone help it was actually asked in exam as following and I need to know whether my answer was right or not? A database management system is a useful tool only if it meets which of the following criteria? A. produces reports B. contains simple records C. meets the needs of its users D. meets the needs of the designer
asked Feb 21, 2020 maddi86 5.4k points