首页 > 解决方案 > Digitalocen 站点部署中的迁移错误

问题描述

当我运行 php artisan migrate 时,出现这样的错误

Illuminate\Database\QueryException  : SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' (SQL: select * from information_schema.tables where table_schema = laravel and table_name = migrations and table_type = 'BASE TABLE')

  at /root/sewa/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\PDOException::("SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'")
      /root/sewa/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

  2   PDOException::("SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'")
      /root/sewa/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

  Please use the argument -v to see more details.

你能帮我解决这个问题吗

标签: laravelmigrationdigital-ocean

解决方案


推荐阅读