Workaround for table is read only in MySQL

Source: Internet
Author: User
Tags drupal

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.