1

i try to install civiCRM on my Drupal 9 local website. I use Mamp 5.5 on Mac.

I follow all install information and now I'm hold on this situation:

% cv core:install --db="mysql://civicrm_user:myuser@localhost:3306/mydb" --lang=it_IT -vv

Box Requirements Checker
========================

> Using PHP 7.4.10
> PHP is using the following php.ini file:
  /usr/local/etc/php/7.4/php.ini

> Checking Box requirements:
  .....

                                                                                
 [OK] Your system is ready to run the application.                              
                                           
  [PDOException]                                    
  SQLSTATE[HY000] [2002] No such file or directory  
                                                    

Exception trace:
 () at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:150
 PDO->__construct() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:150
 Drupal\Core\Database\Driver\mysql\Connection::open() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/Database/Database.php:380
 Drupal\Core\Database\Database::openConnection() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/Database/Database.php:169
 Drupal\Core\Database\Database::getConnection() at n/a:n/a
 call_user_func_array() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php:79
 Drupal\Component\DependencyInjection\PhpArrayContainer->createService() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Component/DependencyInjection/Container.php:171
 Drupal\Component\DependencyInjection\Container->get() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php:212
 Drupal\Component\DependencyInjection\PhpArrayContainer->resolveServicesAndParameters() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php:62
 Drupal\Component\DependencyInjection\PhpArrayContainer->createService() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Component/DependencyInjection/Container.php:171
 Drupal\Component\DependencyInjection\Container->get() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/DrupalKernel.php:546
 Drupal\Core\DrupalKernel->getCachedContainerDefinition() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/DrupalKernel.php:891
 Drupal\Core\DrupalKernel->initializeContainer() at /Users/cmazzarago/Local_Sites/FondazionePico/fondazione_pico/web/core/lib/Drupal/Core/DrupalKernel.php:470
 Drupal\Core\DrupalKernel->boot() at phar:///usr/local/bin/cv/src/CmsBootstrap.php:251
 Civi\Cv\CmsBootstrap->bootDrupal8() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/cv/src/CmsBootstrap.php:139
 Civi\Cv\CmsBootstrap->bootCms() at phar:///usr/local/bin/cv/src/Util/BootTrait.php:130
 Civi\Cv\Command\CoreInstallCommand->_boot_cms_only() at phar:///usr/local/bin/cv/src/Util/SetupCommandTrait.php:54
 Civi\Cv\Command\CoreInstallCommand->bootSetupSubsystem() at phar:///usr/local/bin/cv/src/Command/CoreInstallCommand.php:56
 Civi\Cv\Command\CoreInstallCommand->execute() at phar:///usr/local/bin/cv/vendor/symfony/console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/cv/vendor/symfony/console/Application.php:850
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/cv/vendor/symfony/console/Application.php:193
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/cv/src/Application.php:46
 Civi\Cv\Application->doRun() at phar:///usr/local/bin/cv/vendor/symfony/console/Application.php:124
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/cv/src/Application.php:15
 Civi\Cv\Application::main() at phar:///usr/local/bin/cv/bin/cv:27
 require() at /usr/local/bin/cv:14

core:install [--settings-path [SETTINGS-PATH]] [--setup-path [SETUP-PATH]] [--src-path [SRC-PATH]] [--plugin-path [PLUGIN-PATH]] [--cms-base-url [CMS-BASE-URL]] [--lang [LANG]] [--comp [COMP]] [--ext [EXT]] [--db [DB]] [-m|--model [MODEL]] [-A|--abort] [-K|--keep] [-f|--force] [--debug-event [DEBUG-EVENT]] [--debug-model] [--level LEVEL] [-t|--test] [-U|--user USER]

any suggestion ??? i'm very sad :((

thanks a lot claudio.

1 Answer 1

0

Your --db setting might be wrong. It's not civicrm_user:myuser, it should be myuser:mypass. Also on some systems "localhost" doesn't work and you need to use 127.0.0.1, e.g.

--db="mysql://mysql_user:mysql_password@127.0.0.1:3306/mydb"

But also you don't need --db unless you need to install civi in a separate database from drupal. It will guess your drupal database.

Also you usually need to specify --cms-base-url, since otherwise it might think your website is literally http://default.

8
  • Hi Demerito, i try without --db initially but e received the same error, so next i try with --db parameter. my DB is ok and the web site works properly, so i don't understand why i have this issue :(
    – Claudio
    Dec 2, 2020 at 14:08
  • Did drupal install ok? I mean are you able to visit the drupal site and it works?
    – Demerit
    Dec 2, 2020 at 14:12
  • Yes web site work properly (it's a new installation of Drupal). any suggestion ? thanks
    – Claudio
    Dec 2, 2020 at 14:38
  • Try 127.0.0.1 instead of localhost? - have updated answer.
    – Demerit
    Dec 2, 2020 at 14:56
  • Hi, i tried with --cms-base-url parameter but i received the same error. Now i tried with another Drupal installation on my local with Acquia Dev Desktop and now i have this error: [Drupal\Core\Database\ConnectionNotDefinedException] The specified database connection is not defined: default thai is similar to the previous.
    – Claudio
    Dec 2, 2020 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.