These two days in the website move, this site moved using the form of direct packaging MySQL database and Web files to migrate, upload good MySQL data directory inside the database to MySQL storage database on the VPS, unzip on the line. The path to my VPS storage database is/usr/local/mysql/var.
Upload good site data, decompression, configuration of database link parameters on the line, the site can be connected to the normal, I thought this is a smooth migration completed, but later operation, found that only read the contents of the database, can not be changed to write any information, prompted #1036–table ' * ' is read only (* number is any table), which means that the table has only read-only properties.
Through SSH, to the database file 777 permissions, admin is my database folder
|
1,chmod-r 0777/usr/local/mysql/var/admin/ |
Change the owning user and group of the database directory to MySQL
2. |
Chown-r Mysql:mysql Admin
|
But this can not change the database, first, find mysqladmin location, usually under Mysql/bin, my in/usr/local/mysql/bin, but also need to run the following command:
|
3./mysqladmin-u root-p flush-tables |
After entering the root account password, immediately, without any hint, and then test, can read and write, move will be completed smoothly.
Ext.: http://zhaoxiaoru39.blog.163.com/blog/static/609552192012511104730115/