General error: 1812 occurs with docker + laravel

at first

Trying to make a program using docker + laravel When migrating

$ docker exec -it docker-sample_php-fpm_1 bash
root@39aae0ad8da6:/var/www/html# php artisan migrate

   Illuminate\Database\QueryException 

  SQLSTATE[HY000]: General error: 1812 Tablespace is missing for table `laravel`.`migrations`. (SQL: select `migration` from `migrations` order by `batch` asc, `migration` asc)

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
    667|         // If an exception occurs when attempting to run a query, we'll format the error
    668|         // message to include the bindings with SQL, which will make this exception a
    669|         // lot more helpful to the developer instead of just the database's errors.
    670|         catch (Exception $e) {
  > 671|             throw new QueryException(
    672|                 $query, $this->prepareBindings($bindings), $e
    673|             );
    674|         }
    675| 

      +27 vendor frames 
  28  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) 

There has occurred. Make a note as a memorandum

what's happened?

If you take a closer look at the error you are getting

Tablespace is missing for table `laravel`.`migrations`

Is out. When I log in to the dokcer mysql container and check the table

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| laravel            |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)

mysql> use laravel;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-------------------+
| Tables_in_laravel |
+-------------------+
| failed_jobs       |
| migrations        |
| password_resets   |
| tasks             |
| users             |
+-------------------+
5 rows in set (0.00 sec)

The migrations table exists. Take a look at the contents of the migrations table.

mysql> select * from migrations;
ERROR 1812 (HY000): Tablespace is missing for table `laravel`.`migrations`.

I get an error.

Solution

I've researched various things, but it seems to be quick

mysql> drop table migrations;
Query OK, 0 rows affected (0.02 sec)

If migrate gets stuck at other tables drop table tbl_name

It looks good if you execute.

Let's have a nice docker life

Recommended Posts

General error: 1812 occurs with docker + laravel
Deploy with EC2 / Docker / Laravel
Create Laravel environment with Docker (docker-compose)
Avoid Permission Denied that occurs when developing Laravel with Docker
Build docker + laravel environment with laradock
Laravel development environment construction with Docker (Mac)
Environment construction with Docker (Ubuntu20.04) + Laravel + nginx
Laravel + MySQL + phpMyadmin environment construction with Docker
Display API specifications with Laravel + SwaggerUI + Docker
Docker + Laravel + Codeception
Build a Laravel / Docker environment with VSCode devcontainer
[Docker for Mac] Deal with Credentials store error
[Error resolution] Occurs when trying to build an environment for spring with docker
A simple CRUD app made with Nuxt / Laravel (Docker)
Launch MariaDB with Docker
Rails deploy with Docker
A story that got stuck with an error during migration in docker PHP laravel
Run Pico with docker
Error encountered with notes when deploying docker on rails
Use Puphpeteer with Docker
Operate Emby with Docker
Try WildFly with Docker
Use ngrok with Docker
Docker Compose does not start with docker.credentials.errors.InitializationError error message
Run Payara with Docker
When I bcrypt with node + docker, I got an error
docker error delete command
[Docker] Connection with MySQL
Php settings with Docker
How to make Laravel faster with Docker for Mac
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
[Portfolio] Manage site with laravel APP implementation (Docker environment construction)
Pytorch execution environment with Docker
Use GDAL with Python with Docker
Docker management with VS Code
Run Rails whenever with docker
Get started with DynamoDB with docker
Docker autostart settings with wsl2
npm error in docker tutorial
Error when playing with java
[Docker] Rails 5.2 environment construction with docker
Spring Boot starting with Docker
Build docker environment with WSL
Error with db: migrate: reset
Version control CocoaPods with Docker
Web application built with docker (1)
I tried BIND with Docker
React environment construction with Docker
With the error Cordova-> Looper.prepare ()
Build DynamoDB local with Docker
[Docker] Use whenever with Docker + Rails
Using PlantUml with Honkit [Docker]
Build a SPA for Laravel 6.2 / Vue.js / Nginx / Mysql / Redis with Docker
Solution notes when an error occurs when downloading docker gpg using curl
I got a Permission Denied error when I put Laravel in Docker