[英]Mysql gives me:“Can't open and lock privilege tables: Table 'host' is read only”
I am facing problem restoring the mysql database. 我在还原mysql数据库时遇到问题。 My primary database was mysql5.1 and now I am trying to copy it to mysql5.5.
我的主数据库是mysql5.1,现在我正尝试将其复制到mysql5.5。 The database was backed by using Xtrabackup .
通过使用Xtrabackup支持数据库。
I am using Ubuntu 12.04.3 LTS on this server, mysql version is : 5.5.32-0ubuntu0.12.04.1-log 我在此服务器上使用Ubuntu 12.04.3 LTS,MySQL版本为:5.5.32-0ubuntu0.12.04.1-log
I have followed all the steps to restore using Xtrabackup , this created database files, which I have copied to a tmp directory. 我已经按照所有步骤使用Xtrabackup还原了,这个创建的数据库文件已经复制到tmp目录中。
I have modified my.cnf to point to this tmp directory. 我修改了my.cnf使其指向该tmp目录。 I have changed the tmp directory permissions and changed the ownership of the files to mysql user.
我已经更改了tmp目录权限,并将文件的所有权更改为mysql用户。 drwxr-xr-x 12 mysql mysql 4096 Sep 10 10:04 base
drwxr-xr-x 12个mysql mysql 4096 Sep 10 10:04 base
Now when I start the mysql server I get this error "[ERROR] Fatal error: Can't open and lock privilege tables: Table 'host' is read only" 现在,当我启动mysql服务器时,出现此错误“ [ERROR]致命错误:无法打开和锁定特权表:表'host'是只读的”
I have given a try as follows: 我尝试如下:
Can some please point me in right direction, I am not sure whats wrong with permissions. 能否请您指出正确的方向,我不确定权限有什么问题。
Thanks in advance. 提前致谢。
Answering my own question, 回答我自己的问题,
The issue is with AppArmor. 问题出在AppArmor。 I am not sure why MySql is unable to access files even after uninstalling AppArmor.
我不确定为什么即使卸载AppArmor后MySql也无法访问文件。
Reinstalled AppArmor and moved the MySql profile under disabled profiles of AppArmor, even then it did not work. 重新安装了AppArmor,并将MySql配置文件移到了禁用的AppArmor配置文件下,即使那样也不起作用。
I copied the database files under /var/lib/mysql/ and MySql stopped throwing errors 我将数据库文件复制到/ var / lib / mysql /下,MySql停止抛出错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.