This article summarizes the table is read only solution summary for MySQL in Linux with Windows, and a friend is required to refer to
If it's a database in use, there's a sudden class problem.
Under Linux execute the following command, of course you have to find your MySQL directory
In Linux
Copy the code code as follows:
/usr/local/mysql/bin/mysqladmin-u root-p Flush-tables
The directory here is not necessarily the same, do not know the MySQL installation directory can be used Whereis MySQL to find
In Windows
Lush-tables can be executed in cmd
can also be modified directly using the repair table in phpMyAdmin
If you are importing and restoring data
, so the database folder below all the table files chmod into 777,chown into "_mysql", but this problem is more serious, drupal inside the reality table crached. No way, immediately Google, found that in fact, it is very easy to solve.
First, find the location of mysqladmin, usually under Mysql/bin, and then run the command:
Copy the code code as follows:
./mysqladmin-u Root-p Flush-tables
Then enter the root account password, right away, without any hint, re-open Drupal, everything is OK.
This time, we also found the correct permission settings for the database file: Data under Database folder 700, table file 660, all files should be owned by MySQL.
The following is also the issue of moving from the window database to the Linux server
A discuz forum, originally rack under Windows, with the GBK encoding, MySQL version is 5.0.
Now that I need to move to Linux, I would have suggested using mysqldump to export the method, but colleagues want to use the database directory directly under the data directory.
First try to move the directory, create the database on the new server, and then move the old directory over.
In MySQL, select and the like are normal, but in the Web program prompt: Table ' cdb_posts ' is read only
Change the database directory's owning user and group to MySQL, and add 777 permissions, or just the same.
The same hint is used for root connection in the program.
Want to use Myisamchk to check, also prompt read only.
Workaround for table is read only in MySQL