久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='k7OwV'></tfoot>
    <legend id='k7OwV'><style id='k7OwV'><dir id='k7OwV'><q id='k7OwV'></q></dir></style></legend>

  • <i id='k7OwV'><tr id='k7OwV'><dt id='k7OwV'><q id='k7OwV'><span id='k7OwV'><b id='k7OwV'><form id='k7OwV'><ins id='k7OwV'></ins><ul id='k7OwV'></ul><sub id='k7OwV'></sub></form><legend id='k7OwV'></legend><bdo id='k7OwV'><pre id='k7OwV'><center id='k7OwV'></center></pre></bdo></b><th id='k7OwV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='k7OwV'><tfoot id='k7OwV'></tfoot><dl id='k7OwV'><fieldset id='k7OwV'></fieldset></dl></div>

        • <bdo id='k7OwV'></bdo><ul id='k7OwV'></ul>
      1. <small id='k7OwV'></small><noframes id='k7OwV'>

        Laravel Docker 容器無法連接到遠程 AWS RDS 數據庫

        Laravel Docker Container Cannot connect to remote AWS RDS Database(Laravel Docker 容器無法連接到遠程 AWS RDS 數據庫)
        <legend id='mZYpT'><style id='mZYpT'><dir id='mZYpT'><q id='mZYpT'></q></dir></style></legend>

      2. <tfoot id='mZYpT'></tfoot>
        <i id='mZYpT'><tr id='mZYpT'><dt id='mZYpT'><q id='mZYpT'><span id='mZYpT'><b id='mZYpT'><form id='mZYpT'><ins id='mZYpT'></ins><ul id='mZYpT'></ul><sub id='mZYpT'></sub></form><legend id='mZYpT'></legend><bdo id='mZYpT'><pre id='mZYpT'><center id='mZYpT'></center></pre></bdo></b><th id='mZYpT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mZYpT'><tfoot id='mZYpT'></tfoot><dl id='mZYpT'><fieldset id='mZYpT'></fieldset></dl></div>
          • <bdo id='mZYpT'></bdo><ul id='mZYpT'></ul>

                <tbody id='mZYpT'></tbody>

                <small id='mZYpT'></small><noframes id='mZYpT'>

                  本文介紹了Laravel Docker 容器無法連接到遠程 AWS RDS 數據庫的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我正在使用一個容器化的 Laravel 應用程序,它應該連接到遠程 rds 數據庫,這里是一個示例 .env

                  I'm working with a containerized Laravel app that is supposed to be connecting to a remote rds database, here is a sample .env

                  DB_HOST=xxxxxx.rds.amazonaws.com
                  DB_DATABASE=sample
                  DB_USERNAME=sample
                  DB_PASSWORD=sample
                  DB_PORT=3306
                  DATABASE_DRIVER=mysql
                  

                  容器正常工作,但問題是,當我嘗試運行 composer ie 時,它??無法連接到遠程 rds 數據庫:

                  The container works as it should but the problem is, it cannot connect to the remote rds database, when I try running composer ie:

                  $ docker exec -ti laravel-php bash
                  $ composer install
                  

                  我收到此錯誤:

                  [PDOException]
                  SQLSTATE[HY000] [1045] Access denied for user 'sample'@'192.168.66.1' (using password: YES)  
                                                                                                                          
                  
                  Script php artisan clear-compiled handling the post-install-cmd event returned with error code 1
                  

                  192.168.66.1 作為我的 docker 容器的 ip,我懷疑數據庫策略是通過 @localhost 訪問打開的,因為我的開發人員確認它對公共連接開放.

                  192.168.66.1 as my docker container's ip, I suspect that the db policy is open via @localhost access since my dev ops confirmed that it's open for public connections.

                  順便說一句,我正在使用 docker-compose 版本 2,這是一個示例 docker-compose:

                  I'm using docker-compose version 2 btw, here's a sample docker-compose:

                  version: '2'
                  services:
                  
                      sample-server:
                          build:
                              context: ./
                              dockerfile: sample.server.docker
                          volumes:
                              - ../backend:/var/www
                          ports:
                              - "8081:80"
                          environment:
                              - VIRTUAL_HOST=sample.local
                          links:
                              - sample-php
                          depends_on:
                              - sample-php
                      sample-php:
                          build:
                              context: ./
                              dockerfile: sample.php.docker
                          volumes:
                              - .:/var/www
                          links:
                              - sample-database
                          environment:
                              - "DB_PORT=3306"
                              - "DB_HOST=sample-database"
                      sample-database:
                          image: mysql:5.7
                          environment:
                              - "MYSQL_ROOT_PASSWORD=samplepassword"
                              - "MYSQL_DATABASE=sample"
                          ports:
                              - "33081:3306"
                      sample-nginx-proxy:
                          image: jwilder/nginx-proxy
                          ports:
                              - "80:80"
                          volumes:
                              - /var/run/docker.sock:/tmp/docker.sock:ro
                  networks:
                      default:
                          external:
                              name: sample-nginx-proxy
                  

                  我該如何解決這個問題?

                  How can I fix this?

                  推薦答案

                  檢查以下內容:

                  數據庫可公開訪問:在數據庫所在的 VPC 外部進行連接,更具體地說是通過 Internet 訪問,需要將數據庫配置為公共可訪問性.你說的已經完成了.由于您有內部 IP,而數據庫沒有公共 IP,因此這不是真正必需的.

                  Database is publicly accessible: Connecting outside the VPC that the database resides, more specifically accessed over the internet, requires that the database is configured for Public Accessibility. Which you said is already done. As you have an internal IP, and the database does not have a public IP, this is not really required.

                  基本配置:檢查數據庫名稱和端口是否設置正確,我相信你已經完成了.

                  Basic Configuration: Check that the database name, and port is set correctly, which I am sure you have done.

                  安全組入站規則:這很可能是這種情況,數據庫將有一個或多個 安全組.確保安全組配置為允許從您的案例中的客戶端進行入站訪問:192.168.66.1

                  Security Group Inbound Rules: This is most likely the case, the database will have one or more security groups. Ensure that the security group is configured to allow inbound access from the client in your case: 192.168.66.1

                  確認客戶端的IP地址:192.168.66.1 是容器的奇怪 IP,VPC 子網的前 4 個 IP 地址是 保留.

                  Confirm the IP address of the client: 192.168.66.1 is a strange IP for the container, the first 4 IP Addresses of a VPC Subnet are reserved.

                  確認網絡路由:確認包含客戶端的 VPC 可以連接到數據庫.當客戶端在 docker 容器中運行時,請確保容器可以訪問數據庫.簡單的方法是在數據庫子網中的 EC2 實例上啟用 ICMP 數據包,并檢查您是否可以 Ping 或使用 VPC 路由 分析器.

                  Confirm the network routing: Confirm that the VPC that contains the client can connect to the database. As the client is running within a docker container ensure that the container can access the database. Easy way to do this is enable ICMP packets on an EC2 instance in the database subnet, and check you can Ping it or use the VPC route analyser.

                  檢查數據庫用戶權限:數據庫用戶可以連接任何地址而不是 localhost.

                  Check the database user rights: Can the database user connect for any address not localhost.

                  VPC 的安全性:檢查兩個子網的 ACL入站和出站

                  Security on the VPC: Check the ACLs of the subnets for both inbound and outbound

                  更新:這是來自 AWS 的鏈接:故障排除用于亞馬遜 RDS.

                  UPDATE: Here is a link from AWS: Troubleshooting for Amazon RDS.

                  這篇關于Laravel Docker 容器無法連接到遠程 AWS RDS 數據庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產品、類別和元數據的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統)中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務計劃程序中的 PowerShell MySQL 備份腳本錯誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數據從 XML 文件導入 MySQL 數據庫)
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動時的錯誤)
                  Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小寫表)
                    <tbody id='wbCZk'></tbody>

                  <small id='wbCZk'></small><noframes id='wbCZk'>

                1. <i id='wbCZk'><tr id='wbCZk'><dt id='wbCZk'><q id='wbCZk'><span id='wbCZk'><b id='wbCZk'><form id='wbCZk'><ins id='wbCZk'></ins><ul id='wbCZk'></ul><sub id='wbCZk'></sub></form><legend id='wbCZk'></legend><bdo id='wbCZk'><pre id='wbCZk'><center id='wbCZk'></center></pre></bdo></b><th id='wbCZk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wbCZk'><tfoot id='wbCZk'></tfoot><dl id='wbCZk'><fieldset id='wbCZk'></fieldset></dl></div>
                  <tfoot id='wbCZk'></tfoot>
                  <legend id='wbCZk'><style id='wbCZk'><dir id='wbCZk'><q id='wbCZk'></q></dir></style></legend>
                    <bdo id='wbCZk'></bdo><ul id='wbCZk'></ul>
                            主站蜘蛛池模板: 国产午夜av | 日韩一区二区在线视频 | 日本免费一级片 | 激情五月婷婷丁香 | 国产精品午夜视频 | 国产黄色一区二区 | 黄色成人av| 欧美日日夜夜 | 国产网站免费 | 天堂中文资源在线 | 乳色吐息樱花 | 国产精品综合 | 日韩网站在线观看 | 日韩成人在线播放 | 成人国产一区 | 天天干天天色 | 成人aaaa | 岛国av在线免费观看 | 午夜视频在线免费观看 | 久久精品一区二区三区四区五区 | 一区二区视频在线播放 | 亚洲视频免费在线观看 | 国产一级片在线 | 免费网站观看www在线观看 | 国产精品手机在线 | 午夜视频在线免费观看 | av一区二区三区在线观看 | 丰满少妇高潮 | 亚欧在线观看 | 久久精品欧美一区二区三区不卡 | 日韩在线欧美 | 久久精品99| 一区二区三区精品 | 亚洲人在线观看 | aaa级片| 激情视频网址 | 婷婷六月综合 | 激情五月综合网 | 亚洲黄色免费 | 黄网站免费大全入口 | 青青草免费在线视频 |