実現したいこと
git addできないのですが、どうすれば解決できますか?
前提
こちらの記事を参考に、DockerでPHP+nginx+MySQLの環境構築をしました。
できあがった環境をGitに上げようとしているのですが、git addでエラーが起こってしまいます。
$ git add -A warning: LF will be replaced by CRLF in db/mysql/auto.cnf. The file will have its original line endings in your working directory warning: LF will be replaced by CRLF in db/mysql/ib_buffer_pool. The file will have its original line endings in your working directory error: open("db/mysql/mysql.sock"): Invalid argument error: unable to index file 'db/mysql/mysql.sock' fatal: adding files failed
試したこと
こちらの記事で解決策らしいものが書かれていたので、
当該ディレクトリの権限を調べてみたのですが、記事とは違い、全て自分のユーザー名になっていました。
$ ls -l db/mysql/ total 176275 -rw-r--r-- 1 myusr 197121 56 3月 28 14:56 auto.cnf -rw-r--r-- 1 myusr 197121 1112 3月 28 14:56 ca.pem -rw-r--r-- 1 myusr 197121 1676 3月 28 14:56 ca-key.pem -rw-r--r-- 1 myusr 197121 1112 3月 28 14:56 client-cert.pem -rw-r--r-- 1 myusr 197121 1676 3月 28 14:56 client-key.pem -rw-r--r-- 1 myusr 197121 381 4月 3 15:02 ib_buffer_pool -rw-r--r-- 1 myusr 197121 50331648 4月 3 15:02 ib_logfile0 -rw-r--r-- 1 myusr 197121 50331648 3月 28 14:56 ib_logfile1 -rw-r--r-- 1 myusr 197121 79691776 4月 3 15:02 ibdata1 drwxr-xr-x 1 myusr 197121 0 3月 28 14:56 mysql/ lrwxrwxrwx 1 myusr 197121 27 3月 31 14:24 mysql.sock -> /var/run/mysqld/mysqld.sock # 自分のユーザー名になっている drwxr-xr-x 1 myusr 197121 0 3月 28 14:56 performance_schema/ -rw-r--r-- 1 myusr 197121 1680 3月 28 14:56 private_key.pem -rw-r--r-- 1 myusr 197121 452 3月 28 14:56 public_key.pem -rw-r--r-- 1 myusr 197121 1112 3月 28 14:56 server-cert.pem -rw-r--r-- 1 myusr 197121 1680 3月 28 14:56 server-key.pem drwxr-xr-x 1 myusr 197121 0 3月 28 14:56 sys/ drwxr-xr-x 1 myusr 197121 0 3月 28 14:56 test_php/
もし、権限の設定を変えるとしたら、どういったコマンドを打てばよいでしょうか?
それとも権限の設定でない部分でエラーが起こっているのでしょうか?
ちなみにリポジトリ直下も、DB直下も自分のユーザー名になっていました。
$ ls -l total 4 drwxr-xr-x 1 myusr 197121 0 3月 28 13:53 db/ -rw-r--r-- 1 myusr 197121 762 3月 28 17:06 docker-compose.yml drwxr-xr-x 1 myusr 197121 0 3月 28 17:05 nginx/ drwxr-xr-x 1 myusr 197121 0 3月 28 13:19 php/ $ ls -l db/ total 4 drwxr-xr-x 1 myusr 197121 0 4月 3 15:02 mysql/
Dockerのコンテナは停止中であることも確認しています。
補足情報(FW/ツールのバージョンなど)
Windows
Docker

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2023/04/03 07:21