Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error:我没用laradock的MySQL,使用了自己的远程MySQL。 #2390

Closed
carveybunt opened this issue Dec 1, 2019 · 0 comments
Closed

Comments

@carveybunt
Copy link

  • .env已经设置了 DB_HOST= xx.xx.xx.xx

但是php artisan migrate时,报错:

Illuminate\Database\QueryException  : SQLSTATE[HY000] [1045] Access denied for user 'chen'@'222.87.190.128' (using password: YES) (SQL: select * from informa
tion_schema.tables where table_schema = bbs and table_name = migrations and table_type = 'BASE TABLE')

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

  Exception trace:

  1   Doctrine\DBAL\Driver\PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'chen'@'222.87.190.128' (using password: YES)")
      /var/www/bbs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

  2   PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'chen'@'222.87.190.128' (using password: YES)")
      /var/www/bbs/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

  Please use the argument -v to see more details.

很明显链接的不是我设置的host地址,难道.env的设置失效了吗?我看了一下,这个222.87.190.128是我的电脑的公网ip地址。laradock默认链接的是本机吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant