実現したいこと
dockerで立ち上げたコンテナのMYSQLにログインしたい。
発生している問題・分からないこと
入力時にエラーがでます。VScodeのターミナルが管理者権限ではないのか疑ってます。
エラーメッセージ
error
1PS C:\Users\_te\Desktop\mysql> mysql -u root -h 127.0.0.1 --port 3306 2mysql : The term 'mysql' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the 3name, or if a path was included, verify that the path is correct and try again. 4At line:1 char:1 5+ mysql -u root -h 127.0.0.1 --port 3306 6+ ~~~~~ 7 + CategoryInfo : ObjectNotFound: (mysql:String) [], CommandNotFoundException 8 + FullyQualifiedErrorId : CommandNotFoundException 9
該当のソースコード
docker
1version: '3.8' 2 3services: 4 db: 5 container_name: db 6 image: mysql:8.0.33 7 ports: 8 - 3306:3306 9 10 environment: 11 MYSQL_ROOT_PASSWORD: mysql 12 TZ: Asia/Tokyo #time-zoneの指定. 日本時間(東京)に設定 13 command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci 14 volumes: 15 - ./db/data:/var/lib/mysql 16 - ./db/my.cnf:/etc/mysql/cont.d/my.cnf 17 - ./db/sql:/docker-entrypoint-initdb.d 18
特になし
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
書籍で勉強中です。
パワーシェルの管理者権限で実行されていないのではとの見解があり調整してみました。結果は、administratorとなっていました。
補足
特になし
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2024/03/03 07:46