MySQL错误1036:表是只读的 [英] MySQL error 1036: table is read only
问题描述
当我尝试使用phpmyadmin将记录插入表中时,它给了我
When im trying to insert a record to the table using phpmyadmin it gives me
#1036 - Table 'sch_portfolio' is read only
我在一些文章中看到他们说,如果此表的所有者不是mysql,则可能发生这种情况.所以我将所有者设置为mysql并重新启动服务器.仍然即时通讯收到相同的错误.任何帮助将非常感激.预先感谢
I saw in some articles they said that this could happen if the owner of this table is somthing other than mysql. so i set the owner as mysql and restart the server. Still im getting the same error. any help would be really appreciated. Thanks in advance
drwxrwxrwx 2 mysql mysql 4096 Jul 13 15:27 schooltap
推荐答案
一个需要超级用户priv才能执行此操作,最常见的方法是使用sudo来实现.
One needs super user privs to do this, most commonly sudo is used to acheve this.
也可以依次更改文件的所有者.
in order too Change the owner of the files.
sudo chown -R mysql:mysql /var/lib/mysql
重新启动Mysql以进行更改
Reboot Mysql for the changes
sudo service mysql restart
谁拥有sch_portfolio
并且属于哪个组,应该是mysql:mysql.您还需要重新启动mysql才能使更改生效
who owns sch_portfolio
and what group are they in, should be mysql:mysql. you'll also need to restart mysql for changes to take affect
还要检查当前登录的用户是否具有GRANT访问权限来更新
also check that the currently logged in user had GRANT access to update
MySQL服务器以user mysql
身份运行,而不是以我登录时所用的用户身份运行.为了使其能够访问仅具有用户权限的文件,它们必须由用户‘mysql’
拥有,因为这就是服务器的运行方式.确保mysql使用的文件夹和文件属于用户"mysql".这些文件位于/var/lib/mysql
目录中.目录本身也应该属于‘mysql’
.
The MySQL server is running as user mysql
and not as the user I logged into it with. In order for it to access files that have user only rights they must be owned by user ‘mysql’
since that is what the server is running as. Make sure the folder and files used by mysql belong to the user ‘mysql’. These files are located in the /var/lib/mysql
directory. The directory itself should also belong to ‘mysql’
.
这篇关于MySQL错误1036:表是只读的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!