Home > Database > Mysql Tutorial > mysql的tableisreadonly解决方法_MySQL

mysql的tableisreadonly解决方法_MySQL

WBOY
Release: 2016-06-01 13:00:19
Original
1224 people have browsed it

今天,在centos6下把mysql没法启动的数据库文件夹复制到/usr/local/mysql/var下,结果在修改表时,提示”table isreadonly”的错误。 首先想到的是遇到了权限问题,所以就去/usr/local/mysql/var查看了下,果然所有者不是mysql,权限也不正确。经过下面的步骤
把问题解决了:
1、进入mysql数据库目录,使用命令"chown -R mysql " 和 "chgrp -R mysql "将文件夹拥有者和所在组改为mysql
2、使用命令"chmod -R 760 " 改变权限设置
3、使用命令"mysqladmin -uroot -p reload"重新载入表
4、使用命令"mysqladmin -uroot -p flush-tables"执行刷新

提示: mysql数据库文件拥有者和所在组必须是mysql。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template