执行数据迁移

php artisan migrate

报错:

[PDOException]   PDO::__construct(): php_network_getaddresses: getaddrinfo failed:

网上很多资料说开启allow_open_url等其实没卵用...
貌似问题出在dns上....
原来数据库的配置是这样的

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306

修改成如下:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306

再次执行OK:

[PDOException]   PDO::__construct(): php_network_getaddresses: getaddrinfo failed:

也就是把db_host改成ip形式....至于原因可能是dns问题。。。尚未深究。。。先解决问题吧,回头再研究哈具体原因吧

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2021-12-12
  • 2021-09-30
猜你喜欢
  • 2021-11-15
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案