magestead icon indicating copy to clipboard operation
magestead copied to clipboard

Can't connect to database

Open hex20 opened this issue 8 years ago • 1 comments

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?

hex20 avatar Nov 22 '16 03:11 hex20

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.

richdynamix avatar Nov 28 '16 20:11 richdynamix