Home > Database > Mysql Tutorial > CentOS系统MySQL数据库中Table is read only错的解决

CentOS系统MySQL数据库中Table is read only错的解决

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 17:09:24
Original
1482 people have browsed it

今天服务器从迁移到阿里云主机时遇到一个这样的提示repair数据表的时候出现ldquo;mysql中Table is read onlyrdquo;,Select之类

今天服务器从迁移到阿里云主机时遇到一个这样的提示repair数据表的时候出现“mysql中Table is read only”,

Select之类的都正常,但在网页程序中提示:Table '********' is read only

因为数据较多,导出-》导入比较慢,我是直接压缩,下载然后解压的,考虑到目录权限问题,数据库目录的所属用户和组改为mysql

代码

chown -R mysql:mysql /usr/local/mysql/var

可写权限

chmod -R 0777  /var/lib/mysql/taoniu2007/ 

至此,问题解决。

考虑到数据库版本问题,也许会有同学到这个地方还是read only ,参考下面步骤

程序中使用root连接,也是一样的提示。

想用myisamchk来检查一下,也提示read only。

代码

mysqladmin -u -p flush-tables   


运行flush-tables后,read only问题解决

linux

Related labels:
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