0

[enter image description here][1] After installing composer, when i am trying to install Laravel Breeze i face problem executing this command php artisan migrate

How can i solve this problem?

CMD>> E:\Xampp\htdocs\eshop>php artisan migrate

INFO Preparing database.

Creating migration table ................................................................................. 41ms DONE

INFO Running migrations.

2014_10_12_000000_create_users_table ..................................................................... 14ms FAIL

Illuminate\Database\QueryException

SQLSTATE[HY000]: General error: 1813 Tablespace for table 'laraveleshop.users' exists. Please DISCARD the tablespace before IMPORT (Connection: mysql, SQL: create table users (id bigint unsigned not null auto_increment primary key, name varchar(255) not null, email varchar(255) not null, email_verified_at timestamp null, password varchar(255) not null, remember_token varchar(100) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')

at vendor\laravel\framework\src\Illuminate\Database\Connection.php:793 789▕ // If an exception occurs when attempting to run a query, we'll format the error 790▕ // message to include the bindings with SQL, which will make this exception a 791▕ // lot more helpful to the developer instead of just the database's errors. 792▕ catch (Exception $e) { ➜ 793▕ throw new QueryException( 794▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 795▕ ); 796▕ } 797▕ }

1 vendor\laravel\framework\src\Illuminate\Database\Connection.php:578 PDOException::("SQLSTATE[HY000]: General error: 1813 Tablespace for table 'laraveleshop.users' exists. Please DISCARD the tablespace before IMPORT")

2 vendor\laravel\framework\src\Illuminate\Database\Connection.php:578 PDOStatement::execute()

EFAT KHAN
  • 1
  • 1

1 Answers1

0

To solve your problem, you can use the command 'php artisan migrate:reset' or 'php artisan migrate:refresh' (Laravel documentation).

Alternatively, to do it manually, you need to go back to your database management tool (I use PhpMyAdmin, but there are others like Laragon, etc.), delete the tables that were created during the 'php artisan migrate' command, and then run the command again. However, it is likely that you encountered an issue with the email length, which led you to perform a second migration. Therefore, you will need to fix this issue before doing anything else.

Personally, I solved this problem using this solution that I found on StackOverflow: Laravel Breeze installation problem in laravel 10.