Solved changing localhost => 127.0.0.1
Can't connect to MySQL after PHP 7 Upgrade
Hi,
I'm trying to use PHP 7 in my current Laravel projects, I had compiled PHP 7 into my Homestead machine but, I'm getting the error below:
PDOException in Connector.php line 55: SQLSTATE[HY000] [2002] No such file or directory in Connector.php line 55 at PDO->__construct('mysql:host=localhost;dbname=limasuprimentos', 'homestead', 'secret', array('0', '2', '0', false, false)) in Connector.php line 55 at Connector->createConnection('mysql:host=localhost;dbname=limasuprimentos', array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'limasuprimentos', 'username' => 'homestead', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22 at MySqlConnector->connect(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'limasuprimentos', 'username' => 'homestead', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 60 at ConnectionFactory->createSingleConnection(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'limasuprimentos', 'username' => 'homestead', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 49 at ConnectionFactory->make(array('driver' => 'mysql', 'host' => 'localhost', 'database' => 'limasuprimentos', 'username' => 'homestead', 'password' => 'secret', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'name' => 'mysql'), 'mysql') in DatabaseManager.php line 175 at DatabaseManager->makeConnection('mysql') in DatabaseManager.php line 67 at DatabaseManager->connection('mysql') in Model.php line 3268 at Model::resolveConnection(null) in Model.php line 3234 at Model->getConnection() in Model.php line 1914 at Model->newBaseQueryBuilder() in Model.php line 1857 at Model->newQueryWithoutScopes() in Model.php line 1831 at Model->newQuery() in EloquentUserProvider.php line 92
Please or to participate in this conversation.