Coder Social home page Coder Social logo

Comments (2)

Sen-Bounteous avatar Sen-Bounteous commented on June 19, 2024

Had the exact same issue

Here's how I solved it,
Problem
I think the default username, password and db-name for connecting to the database has changed somehow. So when pulling from acquia, it was not able to connect to the database

Solution
Get the correct info from lando and update it in .lando.yml. Since the new database doesn't exists, we have to manually create it

Steps
I ran this command to get the info

lando info

Got back (username, password, db-name might be different for you)
creds: { database: <db-name>, password: <password>, user: <username> }

Then, get into DB docker container and create the database

lando mysql
create database <db-name>

In .lando.yml, add the credentials

services:
  database:
    portforward: true
    creds:
      user: '<username>'
      password: '<password>'
      database: '<db-name>'

once the configuration is updated, destroy lando and start it again. when db creds are changed, we have to do lando destroy and start it as mentioned here

lando destroy -y && lando start

from lando.

maskedjellybean avatar maskedjellybean commented on June 19, 2024

I ran into this because I had overridden the database creds in .lando.yml to something other than "acquia". Apparently the only way lando pull works with the Acquia recipe is if the database creds in .lando.yml are:

services:
  database:
    creds:
      user: acquia
      password: acquia
      database: acquia

Also in your Drupal settings.php or settings.local.php:

/**
 * When using Lando, use Lando settings.
 * Prepare a LANDO_INFO constant.
 * See: https://jigarius.com/blog/drupal-with-lando
 */
$info = getenv('LANDO_INFO');
if ($info) {
  define('LANDO_INFO', json_decode($info, TRUE));
}

// Configure database for Lando.
if (defined('LANDO_INFO')) {
  if (!isset($databases))
    $databases = array();

  $databases['default']['default'] = [
    'driver' => 'mysql',
    'database' => LANDO_INFO['database']['creds']['database'],
    'username' => LANDO_INFO['database']['creds']['user'],
    'password' => LANDO_INFO['database']['creds']['password'],
    'host' => LANDO_INFO['database']['internal_connection']['host'],
    'port' => LANDO_INFO['database']['internal_connection']['port'],
    'prefix' => '',
  ];
}

from lando.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.