pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="drxnvbf" 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 容器無(wú)法連接到遠(yuǎn)程 AWS RDS 數(shù)據(jù)庫(kù)

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

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

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

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

                  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ù)庫(kù)策略是通過(guò) @localhost 訪問(wèn)打開(kāi)的,因?yàn)槲业拈_(kāi)發(fā)人員確認(rèn)它對(duì)公共連接開(kāi)放.

                  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.

                  順便說(shuō)一句,我正在使用 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è)問(wèn)題?

                  How can I fix this?

                  推薦答案

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

                  數(shù)據(jù)庫(kù)可公開(kāi)訪問(wèn):在數(shù)據(jù)庫(kù)所在的 VPC 外部進(jìn)行連接,更具體地說(shuō)是通過(guò) Internet 訪問(wèn),需要將數(shù)據(jù)庫(kù)配置為公共可訪問(wèn)性.你說(shuō)的已經(jīng)完成了.由于您有內(nèi)部 IP,而數(shù)據(jù)庫(kù)沒(méi)有公共 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ù)庫(kù)名稱和端口是否設(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ù)庫(kù)將有一個(gè)或多個(gè) 安全組.確保安全組配置為允許從您的案例中的客戶端進(jìn)行入站訪問(wè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ù)庫(kù).當(dāng)客戶端在 docker 容器中運(yùn)行時(shí),請(qǐng)確保容器可以訪問(wèn)數(shù)據(jù)庫(kù).簡(jiǎn)單的方法是在數(shù)據(jù)庫(kù)子網(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ù)庫(kù)用戶權(quán)限:數(shù)據(jù)庫(kù)用戶可以連接任何地址而不是 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

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

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

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

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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ù)庫(kù))
                  installed Xampp on Windows 7 32-bit. Errors when starting(在 Windows 7 32 位上安裝 Xampp.啟動(dòng)時(shí)的錯(cuò)誤)
                  Mysql lower case table on Windows xampp(Windows xampp 上的 Mysql 小寫(xiě)表)
                    <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="2cqi20w" 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>
                            主站蜘蛛池模板: crm客户关系管理系统,销售管理系统,crm系统,在线crm,移动crm系统 - 爱客crm | 动库网动库商城-体育用品专卖店:羽毛球,乒乓球拍,网球,户外装备,运动鞋,运动包,运动服饰专卖店-正品运动品网上商城动库商城网 - 动库商城 | 北京翻译公司-专业合同翻译-医学标书翻译收费标准-慕迪灵 | 乳化沥青设备_改性沥青设备_沥青加温罐_德州市昊通路桥工程有限公司 | BOE画框屏-触摸一体机-触控查询一体机-触摸屏一体机价格-厂家直销-触发电子 | 济南拼接屏_山东液晶拼接屏_济南LED显示屏—维康国际官网 | 北京征地律师,征地拆迁律师,专业拆迁律师,北京拆迁律师,征地纠纷律师,征地诉讼律师,征地拆迁补偿,拆迁律师 - 北京凯诺律师事务所 | 3d可视化建模_三维展示_产品3d互动数字营销_三维动画制作_3D虚拟商城 【商迪3D】三维展示服务商 广东健伦体育发展有限公司-体育工程配套及销售运动器材的体育用品服务商 | 深圳宣传片制作-企业宣传视频制作-产品视频拍摄-产品动画制作-短视频拍摄制作公司 | 哈希PC1R1A,哈希CA9300,哈希SC4500-上海鑫嵩实业有限公司 | 黄石东方妇产医院_黄石妇科医院哪家好_黄石无痛人流医院 | 旋振筛|圆形摇摆筛|直线振动筛|滚筒筛|压榨机|河南天众机械设备有限公司 | 地图标注-手机导航电子地图如何标注-房地产商场地图标记【DiTuBiaoZhu.net】 | 猪I型/II型胶原-五克隆合剂-细胞冻存培养基-北京博蕾德科技发展有限公司 | 欧版反击式破碎机-欧版反击破-矿山石料破碎生产线-青州奥凯诺机械 | 机制砂选粉机_砂石选粉机厂家-盐城市助成粉磨科技有限公司 | 气动隔膜泵-电动隔膜泵-循环热水泵-液下排污/螺杆/管道/化工泵「厂家」浙江绿邦 | 深圳办公室装修,办公楼/写字楼装修设计,一级资质 - ADD写艺 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库 | 数控车床-立式加工中心-多功能机床-小型车床-山东临沂金星机床有限公司 | 外观设计_设备外观设计_外观设计公司_产品外观设计_机械设备外观设计_东莞工业设计公司-意品深蓝 | 聚氨酯催化剂K15,延迟催化剂SA-1,叔胺延迟催化剂,DBU,二甲基哌嗪,催化剂TMR-2,-聚氨酯催化剂生产厂家 | 空气能暖气片,暖气片厂家,山东暖气片,临沂暖气片-临沂永超暖通设备有限公司 | 佛山商标注册_商标注册代理|专利注册申请_商标注册公司_鸿邦知识产权 | 上海佳武自动化科技有限公司| 跨境物流_美国卡派_中大件运输_尾程派送_海外仓一件代发 - 广州环至美供应链平台 | 电线电缆厂家|沈阳电缆厂|电线厂|沈阳英联塑力线缆有限公司 | 标策网-专注公司商业知识服务、助力企业发展 | 槽钢冲孔机,槽钢三面冲,带钢冲孔机-山东兴田阳光智能装备股份有限公司 | 农业四情_农业气象站_田间小型气象站_智慧农业气象站-山东风途物联网 | 成都亚克力制品,PVC板,双色板雕刻加工,亚克力门牌,亚克力标牌,水晶字雕刻制作-零贰捌广告 | 胶辊硫化罐_胶鞋硫化罐_硫化罐厂家-山东鑫泰鑫智能装备有限公司 意大利Frascold/富士豪压缩机_富士豪半封闭压缩机_富士豪活塞压缩机_富士豪螺杆压缩机 | 非标压力容器_碳钢储罐_不锈钢_搪玻璃反应釜厂家-山东首丰智能环保装备有限公司 | 搪瓷搅拌器,搪玻璃搅拌器,搪玻璃冷凝器_厂家-淄博越宏化工设备 | 塑料脸盆批发,塑料盆生产厂家,临沂塑料广告盆,临沂家用塑料盆-临沂市永顺塑业 | 识禅_对禅的了解,从这里开始| 集菌仪_智能集菌仪_全封闭集菌仪_无菌检查集菌仪厂家-那艾 | 基业箱_环网柜_配电柜厂家_开关柜厂家_开关断路器-东莞基业电气设备有限公司 | 不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰]-不锈钢法兰-碳钢法兰-法兰盘生产加工厂家-[鼎捷峰] | 冷藏车厂家|冷藏车价格|小型冷藏车|散装饲料车厂家|程力专用汽车股份有限公司销售十二分公司 | 磨煤机配件-高铬辊套-高铬衬板-立磨辊套-盐山县宏润电力设备有限公司 |