'Laravel Database Migration Error PDO\Exception::new(Object(PDOException)) & SQLSTATE[42P07]
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))
Solution 1:[1]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | MohcinBN |
