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
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.
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