Solution to the #1036-Table ''isreadonly error in MySQL in Linux

Source: Internet
Author: User
Tags vps
The problem I encountered was that in navicatmysql, data was transmitted from a mysql Server (formally) to another server (simulating a database ). Is the whole database transmission. Number of simulated instances

The problem I encountered was that in navicat mysql, data was transmitted from a mysql Server (formally) to another server (simulating a database ). Is the whole database transmission. Number of simulated instances

The problem I encountered was that in navicat mysql, data was transmitted from a mysql Server (formally) to another server (simulating a database ). Is the whole database transmission. Rename the data folder of a database in the simulated database, create a new database, and then transmit data. After the transfer is complete, it is found that the table of the database created on the simulation is changed to read-only. The problem is solved by following a similar step in the following article.

During the past two days, the website was migrated in the form of directly packing mysql databases and web files, upload the website database in the mysql data DIRECTORY to the directory where mysql stores the database on VPS, and decompress it. The path for storing my VPS database is/usr/local/mysql/var.

Upload the website data, decompress it, and configure the database link parameters. The website can be connected normally. I thought this was completed successfully, however, during subsequent operations, I found that I could only read the database content and could not write any information. The message #1036-Table '*' is read only (* indicates any Table) was prompted ), that is to say, the table only has read-only attributes.

Use SSH to grant database file 777 permissions. admin is my database folder.

Step 1: chmod-R 0777/usr/local/mysql/var/admin/

Change the user and group of the database directory to MySQL.

1 Step 2: chown-R mysql: mysql admin


However, you cannot change the database. First, find the location of mysqladmin, which is usually under mysql/bin, and in/usr/local/mysql/bin, you also need to run the following command:

1 Step 3:./mysqladmin-u root-p flush-tables

Then, enter the password of the root account. It will be ready immediately without any prompts. Then, test whether the database can be read or written properly and the migration will be completed smoothly.

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.