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 &