25-********* docker使用报错总结 ********

1.chown: changing ownership of '/var/lib/mysql/': Operation not permitted

这里写图片描述

此时/var/lib/mysql/这个目录是远程主机上的目录。往回看我们运行的第一条指令,我们往远程主机上映射的目录是:/tmp/lancmysql:/var/lib/mysql。所以往回倒,相对于在自己本机 /tmp/lancmysq ,这个目录没有操作权限。
因为我的这个/tmp/lancmysqllancmysql目录是用sudo,创建的。所以没有操作权限。把/tmp目录下的lancmysql删除,然后删除已经存在的mysql的container。之后再执行第一句话的时候,执行的时候让他自己创建lancmysql目录。

再运行docker ps,mysql的container就起来了。

原文:https://blog.csdn.net/weixin_41767649/article/details/79584799

posted @ 2020-09-28 18:38  番茄土豆西红柿  阅读(362)  评论(0编辑  收藏  举报
TOP