dtj4307 2019-06-24 14:44
浏览 71

不能php工匠迁移 - Laravel

When running php artisan migrate, It gives following error message

1 PDOException::("SQLSTATE[HY000] [2002] Connection refused") /Users/redblac/olivertes/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

2
PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=oliverte", "root", "", []) /Users/redblac/olivertes/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:70

Turkish language

EDIT: Çözüm - Veritabanında password no özellikli yeni bir kullanıcı oluşturdum ve mamp kullandığım için .env ye DB_SOCKET=/Applications/MAMP/tmp/mysql/mysql.sock ekledim sorun çözüldü.

  • 写回答

1条回答 默认 最新

  • duankangpazhuo0347 2019-06-24 20:15
    关注

    The exception means artisan is not able to connect to your database. Try figuring out the following things:

    • Make sure you have a database up and running
    • Make sure the database is not behind a firewall
    • Make sure you can connect to the database via a separate sql client
    • Make sure you have your database credentials configured correctly in your .env file
    • You could check out Laravel documentation on databases and environment configuration

    If you want more help on this, try providing us with some more information as to how you have setup your development environment.

    评论

报告相同问题?

悬赏问题

  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线