Are you able to connect with plain PDO? Marco Pivetta
http://twitter.com/Ocramius http://ocramius.github.com/ On Thu, Jun 27, 2019 at 9:03 PM Nathaniel Goodwin <[email protected]> wrote: > Using > > ``` > "php": "^7.1.3", > "doctrine/doctrine-bundle": "^1.11", > "doctrine/doctrine-fixtures-bundle": "^3.1", > "doctrine/doctrine-migrations-bundle": "^2.0", > "doctrine/orm": "^2.6", > "friendsofsymfony/oauth-server-bundle": "^1.6", > "friendsofsymfony/rest-bundle": "^2.5", > "friendsofsymfony/user-bundle": "^2.1", > "jms/serializer-bundle": "^3.3", > "symfony/asset": "4.2.*", > "symfony/yaml": "4.2.*" > ``` > > I cannot seem to get my configuration correct to connect my Symfony > Doctrine PHP API to my MySQL database on AWS DB instance. I am running > Ubuntu 16+ on all my instances. I am able to connect my local API to my > local MySQL without any problems, and I am able to connect my testing > server in the same way, but when I move to my production server on AWS, and > I try to run the following: > > ``` > php bin/console doctrine:schema:update --force --env=prod --complete > ``` > > I get the following error: > > ``` > In AbstractMySQLDriver.php line 93: An exception occurred in driver: > SQLSTATE[HY000] [2002] No such file or directory > ``` > > I have tried multiple configuration settings and many searches, but in > almost all cases the issues were with settings using localhost versus > 127.0.0.1, and that is not my issue as I am trying to connect from an AWS > EC2 (hosting my API) to an AWS DB instance. > > I have checked multiple times and my username, database, password, and > path configurations are correct, I have tested them via manual login to the > DB instance. > > Here is the config in my config/packages/doctrine.yaml > > ``` > > doctrine: > dbal: > # configure these for your database server > driver: 'pdo_mysql' > server_version: '5.7' > charset: utf8 > default_table_options: > charset: utf8 > collate: utf8_unicode_ci > host: 'api-database.XXXXXXXXXXX.ca-central-1.rds.amazonaws.com > ' > port: '3306' > dbname: 'XXXXXXX' > user: 'XXXXX' > password: 'XXXXXXXXXXXXXXXXXXXXXXX' > orm: > auto_generate_proxy_classes: true > naming_strategy: doctrine.orm.naming_strategy.underscore > auto_mapping: true > mappings: > App: > is_bundle: false > type: annotation > dir: '%kernel.project_dir%/src/Entity' > prefix: 'App\Entity' > alias: App > monolog: > handlers: > main: > type: stream > path: '%kernel.logs_dir%/%kernel.environment%.log' > level: debug > channels: ['!event'] > > ``` > > -- > You received this message because you are subscribed to the Google Groups > "doctrine-user" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/doctrine-user. > To view this discussion on the web visit > https://groups.google.com/d/msgid/doctrine-user/4d8b86ce-61e5-4c8c-a685-83c68eea8c91%40googlegroups.com > <https://groups.google.com/d/msgid/doctrine-user/4d8b86ce-61e5-4c8c-a685-83c68eea8c91%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/doctrine-user. To view this discussion on the web visit https://groups.google.com/d/msgid/doctrine-user/CADyq6s%2BcPJqRWNY1VMuPf%2BpnjVXJzOpnB5QAK-g0%2Bp9_RseMJQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
