久久久久久久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 容器無法連接到遠(yuǎn)程 AWS RDS 數(shù)據(jù)庫

        Laravel Docker Container Cannot connect to remote AWS RDS Database(Laravel Docker 容器無法連接到遠(yuǎn)程 AWS RDS 數(shù)據(jù)庫)
        <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 容器無法連接到遠(yuǎn)程 AWS RDS 數(shù)據(jù)庫的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時(shí)送ChatGPT賬號..

                  我正在使用一個(gè)容器化的 Laravel 應(yīng)用程序,它應(yīng)該連接到遠(yuǎn)程 rds 數(shù)據(jù)庫,這里是一個(gè)示例 .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
                  

                  容器正常工作,但問題是,當(dāng)我嘗試運(yùn)行 composer ie 時(shí),它??無法連接到遠(yuǎn)程 rds 數(shù)據(jù)庫:

                  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
                  

                  我收到此錯(cuò)誤:

                  [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,我懷疑數(shù)據(jù)庫策略是通過 @localhost 訪問打開的,因?yàn)槲业拈_發(fā)人員確認(rèn)它對公共連接開放.

                  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,這是一個(gè)示例 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
                  

                  我該如何解決這個(gè)問題?

                  How can I fix this?

                  推薦答案

                  檢查以下內(nèi)容:

                  數(shù)據(jù)庫可公開訪問:在數(shù)據(jù)庫所在的 VPC 外部進(jìn)行連接,更具體地說是通過 Internet 訪問,需要將數(shù)據(jù)庫配置為公共可訪問性.你說的已經(jīng)完成了.由于您有內(nèi)部 IP,而數(shù)據(jù)庫沒有公共 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.

                  基本配置:檢查數(shù)據(jù)庫名稱和端口是否設(shè)置正確,我相信你已經(jīng)完成了.

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

                  安全組入站規(guī)則:這很可能是這種情況,數(shù)據(jù)庫將有一個(gè)或多個(gè) 安全組.確保安全組配置為允許從您的案例中的客戶端進(jìn)行入站訪問: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

                  確認(rèn)客戶端的IP地址:192.168.66.1 是容器的奇怪 IP,VPC 子網(wǎng)的前 4 個(gè) 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.

                  確認(rèn)網(wǎng)絡(luò)路由:確認(rèn)包含客戶端的 VPC 可以連接到數(shù)據(jù)庫.當(dāng)客戶端在 docker 容器中運(yùn)行時(shí),請確保容器可以訪問數(shù)據(jù)庫.簡單的方法是在數(shù)據(jù)庫子網(wǎng)中的 EC2 實(shí)例上啟用 ICMP 數(shù)據(jù)包,并檢查您是否可以 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.

                  檢查數(shù)據(jù)庫用戶權(quán)限:數(shù)據(jù)庫用戶可以連接任何地址而不是 localhost.

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

                  VPC 的安全性:檢查兩個(gè)子網(wǎng)的 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.

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

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

                  相關(guān)文檔推薦

                  SQL query to get all products, categories and meta data woocommerce/wordpress(獲取所有產(chǎn)品、類別和元數(shù)據(jù)的 SQL 查詢 woocommerce/wordpress)
                  How to use MySQL in WSL (Windows Subsystem for Linux)?(如何在 WSL(Linux 的 Windows 子系統(tǒng))中使用 MySQL?)
                  PowerShell MySQL Backup Script Error in Task Scheduler 0x00041301(任務(wù)計(jì)劃程序中的 PowerShell MySQL 備份腳本錯(cuò)誤 0x00041301)
                  Import the data from the XML files into a MySQL database(將數(shù)據(jù)從 XML 文件導(dǎo)入 MySQL 數(shù)據(jù)庫)
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動時(shí)的錯(cuò)誤)
                  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>
                            主站蜘蛛池模板: www.日韩系列| 欧美高清性xxxxhdvideosex | 久久久精彩视频 | 精品在线一区二区三区 | 亚洲免费毛片 | 精品久久久久久久久久久下田 | 欧美精品第一页 | caoporn国产精品免费公开 | 日韩一区二区黄色片 | 日本网站在线看 | 97国产超碰 | 免费日本视频 | 日韩二三区| 夏同学福利网 | 中文字幕在线免费视频 | 国产精品毛片一区二区在线看 | 亚洲视频精品在线 | 国产一区久久久 | 成人精品国产一区二区4080 | 欧美日产国产成人免费图片 | 国产91亚洲精品一区二区三区 | 91社区在线观看播放 | 日日操夜夜操天天操 | 欧美视频精品 | 美女一级a毛片免费观看97 | 精品久久久久久久久久久 | 久久久久久www | 国产精品免费一区二区三区四区 | 懂色一区二区三区免费观看 | 性在线 | 亚洲日本欧美日韩高观看 | 国产高清视频 | 成人精品在线视频 | 亚洲欧美激情精品一区二区 | 最新中文字幕第一页视频 | 欧美一区日韩一区 | 精品久久久久久中文字幕 | 午夜精品久久久久久久 | 日日夜夜天天 | h肉视频 | 人人射人人 |