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.

Illuminate\Database\QueryException could not find driver (Connection: mysql, SQL: select table_name as `name`, (data_length + index_length) as `size`, table_comment as `comment`, engine as `engine`, table_collation as `collation` from information_

Last updated at Posted at 2024-02-28

Ubuntu: 22.04
XAMPP: xampp-linux-x64-8.2.12-0-installer
laravel: 10.x

php artisan migrate

エラーが表示される

 Illuminate\Database\QueryException 

  could not find driver (Connection: mysql, SQL: select table_name as `name`, (data_length + index_length) as `size`, table_comment as `comment`, engine as `engine`, table_collation as `collation` from information_schema.tables where table_schema = 'mysql' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

解決方法

sudo apt install php-mysql

php-mysqlをインストール後、php artisan migrateを実行する。
その後、次のエラーが表示された場合の解決方法

SQLSTATE[HY000] [2002] No such file or directory ..................

解決方法

/opt/lampp/etc/my.cnfファイルのsocketの設定値を確認する

socket		=/opt/lampp/var/mysql/mysql.sock

シンボリックリンクを作成する

sudo ln -s /opt/lampp/var/mysql/mysql.sock /tmp/mysql.sock
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?