我得到了一个laravel项目的git副本,管理员给了我一个sql,说我需要导入它并配置laravel来启动这个项目。
我已经尝试了很多方法,比如 https://gist.github.com/hootlex/da59b91c628a6688ceb1
除了重新安装composer和尝试将db上传到phpmyadmin之外,我还不断遇到错误: composer install
给予
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
In Connection.php line 664:
SQLSTATE[HY000] [1049] Unknown database 'dbname' (SQL: select * from `system_configs`)
In PDOConnection.php line 50:
SQLSTATE[HY000] [1049] Unknown database 'dbname'
In PDOConnection.php line 46:
SQLSTATE[HY000] [1049] Unknown database 'dbname'
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
``` `composer.phar install` 退货
Could not open input file: composer.phar `php artisan serve` 给予
In Connection.php line 664:
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
(SQL: select * from system_configs
)
In PDOConnection.php line 50:
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
In PDOConnection.php line 46:
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
根本没有 `PDOConnection.php` 以及 `database.php` 似乎和我在网上看到的一致 `.env` 文件。
我有一种感觉,我错过了一件非常简单的事情——当你必须导入一个管理员说是执行它的关键的sqldb时,你如何在git copy laravel项目中工作?
1条答案
按热度按时间w80xi6nr1#
所以,问题出在db本身,而不是我在做什么;pdo是laravel用来与您使用的数据库(sql)通信的php模块,因此在我通过phpmyadmin将我的数据库导入一个新表之后,laravel应该可以毫无问题地访问它(过程是:laravel->php/pdo->phpmyadmin->db)。
我不得不禁用外国支票做进口正确,这解决了问题。