- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经创建了一个 docker compose 文件来运行 mysql docker 容器并使用数据库脚本初始化数据库。
启动容器时出现以下错误。
account-service-db_1 | Initializing database
account-service-db_1 | mysqld: Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied)
account-service-db_1 | 2019-05-11T16:58:35.265463Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.
account-service-db_1 | 2019-05-11T16:58:35.265550Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.0.16) initializing of server in progress as process 15
account-service-db_1 | 2019-05-11T16:58:35.268464Z 0 [ERROR] [MY-010460] [Server] --initialize specified but the data directory exists and is not writable. Aborting.
account-service-db_1 | 2019-05-11T16:58:35.268472Z 0 [ERROR] [MY-013236] [Server] Newly created data directory /var/lib/mysql/ is unusable. You can safely remove it.
account-service-db_1 | 2019-05-11T16:58:35.269284Z 0 [ERROR] [MY-010119] [Server] Aborting
account-service-db_1 | 2019-05-11T16:58:35.270510Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.16) MySQL Community Server - GPL.
docker-swarm-account-service-mysql-demo_account-service-db_1 exited with code 1
经过研究,许多人建议在撰写文件中添加用户:“1000:50”将解决问题。但添加后我也遇到了同样的错误。
请在下面找到我的 docker-compose 文件
version: '3.7'
services:
account-service-db:
user: "1000:50"
image: mysql
environment:
- MYSQL_DATABASE=account-service
- MYSQL_USER=mysqluser
- MYSQL_PASSWORD=mysqlpassword
- MYSQL_ROOT_PASSWORD=mysqlpassword
volumes:
- "/Users/admin/dockerfiles/docker-swarm-account-service-mysql-demo/scripts/:/docker-entrypoint-initdb.d/"
- "/Users/admin/dockerfiles/docker-swarm-account-service-mysql-demo/account:/var/lib/mysql"
ports:
- "3306:3306"
deploy:
replicas: 1
placement:
constraints:
- node.labels.mysql.node == true
restart_policy:
condition: on-failure
delay: 10s
#max-attempts: 3
我正在 mac 机器上执行上述场景。请帮助我为什么在授予卷和脚本文件夹所有必要的权限后它的行为是这样的。
最佳答案
问题似乎与您的 account
文件夹有关。它可能已在使用中或已损坏。创建一个新文件夹并进行测试。
从撰写文件中的环境值中删除双引号。
如果正在挂载的主机上的文件夹没有所需的写入权限:
chmod -R a+rwx/path/to/account/folder
关于mysql docker 容器未启动,mysqld : Can't create/write to file '/var/lib/mysql/is_writable' (OS errno 13 - Permission denied),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56092699/
我正在运行以下代码,并将在下面给出 CHMOD 和 CHOWN 值。但由于某种原因 is_writable 一直失败。 if (!is_writeable($this->path)) { echo
为什么对目录具有正确权限的 PHP 仍然返回 FALSE? 我尝试过 chmod 777 到脚本说不可写的目录,然后 chown 到 root 和 apache。 if (!is_writable($
我正在尝试安装基于 PHP 的 software package在使用 yum 安装了 Apache 2.4.6 和 PHP 5.4.16 的 Red Hat 7 Amazon EC2 实例 (ami
当我使用 thix 时,thix ix 一切正常,它显示了所有子文件夹以及子文件夹的子文件夹 '; foreach($folders as $subFolders){ if($
有人对此有任何想法吗?我用 file_exists() 和 is_writable() 检查文件,它们都返回 true。为了安全起见,我将目录和文件设置为 777,但是尝试 fwrite() 或 fi
抱歉,我不确定这是否是正确的论坛,因为我不知道问题的原因,我正在面对。 我在 Raspbian (Stretch 9) 上安装了 NextCloud,并将数据目录移动到挂载的 NFS 文件夹中。当我尝
我已经用谷歌搜索这个问题两天了,真的没有找到任何人可以给我一个可靠的答案。也许 stackoverflow 的天才们可以提供帮助? 我的难题:我正在尝试使用 URL 语法来读取和写入文件,该 URL
即使 is_writable() 返回 true,我也无法写入文件。当然,该文件存在并且显然是可读的。这是代码: $file = "data"; echo file_get_contents($fil
我有一个相对文件夹“files/crm-upload”,我想在其中上传文件。我的代码会检查 is_writable() 是否为真,并且只有在这种情况下才会继续。 该文件夹作为 NFS 共享挂载,rw
我正在尝试在 Ubuntu 14.04 上安装 MySQL 5.7。 以下是我遵循的步骤: rm -rf /var/lib/mysql mkdir -p /var/lib/mysql cd wget
我在使用 docker compose 启动数据库服务时遇到问题: version: '3' services: # Mysql DB db: image: percon
我已经创建了一个 docker compose 文件来运行 mysql docker 容器并使用数据库脚本初始化数据库。 启动容器时出现以下错误。 account-service-db_1 | In
我是一名优秀的程序员,十分优秀!