richdynamix / magestead

The Vagrant Solution for Magento Developers
81 stars 29 forks source link

Can't connect to database #81

Open hex20 opened 7 years ago

hex20 commented 7 years ago

I can ssh into the database from Sequel pro but when Magento tries to connect I get SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known. I just have the default local.xml file which looks like this

        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[magestead]]></username>
                    <password><![CDATA[vagrant]]></password>
                    <dbname><![CDATA[magestead]]></dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>

Anybody know why this would be?

richdynamix commented 7 years ago

What connection details are you using to connect with Sequel Pro? I just connect using SSH tunnel using vagrant default connections then connect to the DB using the setup credentials.