フォーラム掲示板について

以下の目的、注意点などご確認いただき、ご使用ください。

目的
Connect-CMSのユーザやConnect-CMSに興味のある方同士で自由に意見交換できる場を提供する目的で、コミュニティ掲示板として提供しています。
投稿方法
このサイトにユーザー登録することで、投稿することができます。
投稿内容
投稿内容は公開されます。
Connect-CMSに無関係な内容が記載されたと判断した場合、削除することがあります。
バグ情報
バグ(不具合)はGithub のIssues(https://github.com/opensource-workshop/connect-cms/issues)に記載していただくと、開発者に伝わりやすくなります。
また、セキュリティなど重大な事象の場合は、お問い合わせページよりお知らせください。優先的に調査いたします。
また、貢献ガイド(https://connect-cms.jp/abount/contributions)も参照をお願いします。

フォーラムでのサポート範囲

当フォーラムでは、Connect-CMSのトラブルなどの相談も記載いただけますが、作業を肩代わりするものではありません。
作業の依頼は、株式会社オープンソース・ワークショップの調査メニューなどをご検討ください。
https://opensource-workshop.jp/service/rescue

フォーラム掲示板

Re: migrate でエラー、原因等をお教え下さい。

2021年7月28日 01時21分 [公星]

 

『could not find driver』とありますので、
「Conect-CMS(=Laravel)がデータベースを操作するためのドライバが見つからない」という状態になっているようです。

さしあたり、お使いのLinuxに「php-pdophp-mysqlndがインストールされているかの確認から始めてはいかがでしょうか。

 

(更新:2021年7月28日 01時45分)
スレッドの記事一覧

自宅PCにLINUX環境を構築してインストールをトライアル中です。

migrate段階で以下のエラーが発生してしまいました。原因・対応策等をお教え頂きたく宜しくお願い致します。

<<エラー内容>>

[root@localhost connect-cms]# php artisan migrate

   Illuminate\Database\QueryException  : could not find driver (SQL: select * from information_schema.tables where table_schema = hpdb and table_name = migrations and table_type = 'BASE TABLE')

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

  Exception trace:

  1   Doctrine\DBAL\Driver\PDO\Exception::("could not find driver")
      /var/www/html/connect-cms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18

  2   Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
      /var/www/html/connect-cms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43

  Please use the argument -v to see more details.

Re: migrate でエラー、原因等をお教え下さい。
2021-07-28 [公星]

 

『could not find driver』とありますので、
「Conect-CMS(=Laravel)がデータベースを操作するためのドライバが見つからない」という状態になっているようです。

さしあたり、お使いのLinuxに「php-pdophp-mysqlndがインストールされているかの確認から始めてはいかがでしょうか。

 

有難う御座います。

php-mysqlndがインストールされていなかったので、インストールして再実行しました。

エラーの内容が以下に変化しました。

<<php artisan migrate>>

  Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 'hpuser'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = hpdb and table_name = migrations and table_type = 'BASE TABLE')

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

  Exception trace:

  1   Doctrine\DBAL\Driver\PDO\Exception::("SQLSTATE[HY000] [1045] Access denied for user 'hpuser'@'localhost' (using password: NO)")
      /var/www/html/connect-cms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18

  2   Doctrine\DBAL\Driver\PDO\Exception::new(Object(PDOException))
      /var/www/html/connect-cms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43

  Please use the argument -v to see more details.

 
Access denied for user 'hpuser'@'localhost' (using password: NO)
→ ユーザー'hpuser'@localhostのアクセスが拒否されました。(パスワードの使用:NO)
 
とありますので、.env ファイルの「 DB_PASSWORD= 」が空白、
または正しく反映されていないことが考えられます。
 
.env ファイルの「 DB_PASSWORD= 」の入力を確認してください。
 
 
---
 
・「DB_PASSWORD=#123456」 のように、#でパスワードが始まっていませんか?
 (#の後はコメントアウトとして扱われる)
 
・「hpuser」はLinuxの usradd で作成したユーザーではなく、
  MySQL(またはMariaDB)にログインして作成したユーザーですよね?
 
・正しく.envが記述されているにも関わらずエラーが発生するなら、
 「 php artisan config:clear 」をやって、一旦、キャッシュされた設定をクリアしてから
 再びmigrateを実行してみるとうまくいくかもしれません。

 

パスワードを#・・・にしていました。

これを修正し、無事にmigrate を通過致しました。

有難う御座いました。(本件、クローズ)