Troubleshooting MySQL Error #1036 Table is read only error method

Source: Internet
Author: User
Tags flush vps

The site to move the use of direct packaging MySQL database and Web files in the form of migration, upload good MySQL data directory inside the site database to the VPS MySQL storage database directory inside, decompression on the line. My VPS Store database path is/usr/local/mysql/var.
Upload good site data, decompression, configure the database link parameters on the line, the site will be able to connect the normal, I thought this has been a smooth migration completed, but later operation, found only read the contents of the database, can not change the write any information, prompted #1036–table ' * ' is read only (* is any table), which means that the table has only read-only properties.
Through SSH, give the database file 777 permissions, Dedeadmin is my database folder

Chmod-r 0777/usr/local/mysql/var/dedeadmin/

Change the user and group to MySQL for the database directory

Chown-r Mysql:mysql Dedeadmin

But this can not change the database, first of all, find mysqladmin location, generally under Mysql/bin, my/usr/local/mysql/bin inside, also need to run the following command:

./mysqladmin-u Root-p Flush-tables

Then enter the password of the root account, immediately good, without any hint, and then test, can read and write, moving also smooth finish

-----------

Solutions in Linux

1. Locate the directory where the database files are placed, such as/usr/local/mysql/var/xx

2. Change ownership of all files under this database: Chown mysql.mysql *.*

3. Close Mysql:killall mysqld

4. Open MySQL: Enter MySQL bin directory, run./mysqld_safe--user=mysql &

------------

A few days ago I put a system on the server, the database has the following error prompts

#1036-table ' is read only

I put the site to the server, the backup of the database files under/usr/local/mysql/var, access to a table when the issue of permissions, and then the database permissions to 777, the database directory of users and groups to MySQL, the error persists. I used the method to solve the problem.

First of all, find the location of mysqladmin, usually under Mysql/bin, my under/usr/local/mysql/bin. The steps are as follows:

#cd/usr/local/mysql/bin

#./mysqladmin-u root-p Flush-tables

Then enter your database password, without any error prompts, indicating that you have succeeded

If it is Linux you can do the following

Nux under the MySQL problem, prompted MySQL error #1036-table ' xxxx ' is read only

Workaround:

1. Locate the directory where the database files are placed, such as/usr/local/mysql/var/xx

2. Change ownership of all files under this database: Chown mysql.mysql *.*

3. Close Mysql:killall mysqld

4. Open MySQL: Enter MySQL bin directory, run./mysqld_safe--user=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.