0
sudo php bin/console doctrine:database:create

In AbstractMySQLDriver.php line 125:

  An exception occurred in driver: could not find driver


In PDOConnection.php line 50:

  could not find driver


In PDOConnection.php line 46:

  could not find driver


doctrine:database:create [--shard SHARD] [--connection [CONNECTION]] [--if-not-exists] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--] <command>

please help .

3
  • Have you installed pdo_mysql, or whatever are you using? Commented May 27, 2018 at 19:12
  • Run composer install and check if PDO driver is in installed Commented May 27, 2018 at 19:13
  • Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files ocramius/package-versions: Generating version class... ocramius/package-versions: ...done generating version class Executing script cache:clear [OK] Executing script assets:install --symlink --relative public [OK] result if I check composer install Commented May 27, 2018 at 19:20

2 Answers 2

1

You have to enable PDO extension.

If you are on a Windows machine look in your php.ini file and uncomment extension=php_pdo_mysql.dll. The path to your php.ini file can be found by looking at your phpinfo().

Debian/Ubuntu

PHP 5 sudo apt-get install php5-mysql

PHP 7 sudo apt-get install php7.0-mysql

You will then need to ensure the module is enabled:

sudo phpenmod pdo_mysql

Then restart Apache:

sudo service apache2 restart 
Sign up to request clarification or add additional context in comments.

2 Comments

error : sudo apt-get install php7.0-mysql Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait E: Impossible de trouver le paquet php7.0-mysql E: Impossible de trouver de paquet correspondant à l'expression rationnelle « php7.0-mysql » E: Impossible de trouver de paquet correspondant à l'expression rationnelle « php7.0-mysql »
You must translate the output. Show the output of the following command: php -v
0

Check if your php.ini file has the lines :

extension=pdo_mysql
extension=pdo_pgsql
extension=mysqli

1 Comment

From next time onwards, use code formatting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.