0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Unknown database 'データベース名'の対処法

Posted at

開発環境

Laravel 8.0
PHP 8.1.4
Mysql 8.0.28

エラー発生状況

1.新規アプリ作成後、php artisan migrateでマイグレーションを実行
2.エラー発生

terminal
SQLSTATE[HY000] [1049] Unknown database 'laravel' (SQL: select * from information_schema.tables where table_schema = Laravel and table_name = migrations and table_type = 'BASE TABLE')

対処法

Mysql上にlaravelという名前のデータベースがないようなので、laravelでデータベースを作成。

terminal
mysql> mysql -u root 
mysql> create database laravel; 

※データベース名は自分が作成しているアプリ名でも可。
 例: testappというアプリを作成しているのなら、create database testapp等

参考情報

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?