Laravel-9 Doctrine schema creation exception: No handler for this scheme

Viewed 17

I've followed the Doctrine documentation to install it in Laravel 9: http://laraveldoctrine.org/docs/1.8/orm/installation

I've changed the .env to connect to my DB which is already created.

I've created a file app/Entities/RiskType.php:

namespace App\Entities;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="RiskTypes")
 */
class RiskType
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;


    /**
     * @ORM\Column(type="string",length=128,nullable=true)
     */
    private $name;

    public function __construct($name)
    {
        $this->name = $name;
    }

    public function getId()
    {
        return $this->id;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }
}

Then I'm trying to create the table with

php artisan doctrine:schema:create

and get the following exception:

Doctrine\DBAL\Exception\ConnectionException

An exception occurred in driver: SQLSTATE[HY000] [2002] No handler for this scheme

What's wrong here?

0 Answers
Related