Home > Software design >  Laravel Database Migration Error PDO\Exception::new(Object(PDOException)) & SQLSTATE[42P07]
Laravel Database Migration Error PDO\Exception::new(Object(PDOException)) & SQLSTATE[42P07]

Time:03-10

Hello im begginer at laravel I was given a repo with database, and then when i want run new migration -php artisan migrate it gives an exception like this picture, anyone know how to solve this? thx before

laravel\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDO\Exception.php:18 Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "personal_access_tokens" already exists")

laravel\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOStatement.php:119 Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))

enter image description here

CodePudding user response:

Try to follow those steps:

1.Run git clone <project-name-from-github>
2.Run composer install
3.Run cp .env.example .env
4.Run php artisan key:generate
5.Run php artisan migrate or php artisan migrate:fresh --force
6.Run php artisan serve
  • Related