网站从NGINX环境迁移到Apache环境后报错

目前迁移的方法是从原NGINX机器打包网站程序,导出mysql文件,上传到新Apache环境机器,导入mysql文件,php版本一致,数据库信息一致,域名一致。

目前打开任何页面都报如下错误:

Illuminate\Database\QueryException thrown with message "SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) (SQL: select `id` from `ask_tags`)"


Stacktrace:

#86 Illuminate\Database\QueryException in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664

#85 Doctrine\DBAL\Driver\PDOException in /www/wwwroot/aabbcc.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:31

#84 PDOException in /www/wwwroot/aabbcc.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

#83 PDO:__construct in /www/wwwroot/aabbcc.com/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:27

#82 Doctrine\DBAL\Driver\PDOConnection:__construct in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:65

#81 Illuminate\Database\Connectors\Connector:createPdoConnection in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:44

#80 Illuminate\Database\Connectors\Connector:createConnection in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php:24

#79 Illuminate\Database\Connectors\MySqlConnector:connect in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php:182

#78 Illuminate\Database\Connectors\ConnectionFactory:Illuminate\Database\Connectors\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:915

#77 call_user_func in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:915

#76 Illuminate\Database\Connection:getPdo in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:940

#75 Illuminate\Database\Connection:getReadPdo in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:399

#74 Illuminate\Database\Connection:getPdoForSelect in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:325

#73 Illuminate\Database\Connection:Illuminate\Database\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:657

#72 Illuminate\Database\Connection:runQueryCallback in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:624

#71 Illuminate\Database\Connection:run in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Connection.php:333

#70 Illuminate\Database\Connection:select in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:1963

#69 Illuminate\Database\Query\Builder:runSelect in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2155

#68 Illuminate\Database\Query\Builder:Illuminate\Database\Query\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2435

#67 Illuminate\Database\Query\Builder:onceWithColumns in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2157

#66 Illuminate\Database\Query\Builder:pluck in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php:677

#65 Illuminate\Database\Eloquent\Builder:pluck in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1570

#64 Illuminate\Database\Eloquent\Model:__call in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1582

#63 Illuminate\Database\Eloquent\Model:__callStatic in /www/wwwroot/aabbcc.com/app/Models/Taggable.php:20

#62 App\Models\Taggable:hottest in /www/wwwroot/aabbcc.com/app/Models/Taggable.php:39

#61 App\Models\Taggable:App\Models\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Cache/Repository.php:327

#60 Illuminate\Cache\Repository:remember in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php:304

#59 Illuminate\Cache\CacheManager:__call in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:223

#58 Illuminate\Support\Facades\Facade:__callStatic in /www/wwwroot/aabbcc.com/app/Models/Taggable.php:49

#57 App\Models\Taggable:globalHotTags in /www/wwwroot/aabbcc.com/app/Http/Controllers/IndexController.php:36

#56 App\Http\Controllers\IndexController:index in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54

#55 call_user_func_array in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54

#54 Illuminate\Routing\Controller:callAction in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45

#53 Illuminate\Routing\ControllerDispatcher:dispatch in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php:212

#52 Illuminate\Routing\Route:runController in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php:169

#51 Illuminate\Routing\Route:run in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php:665

#50 Illuminate\Routing\Router:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30

#49 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/app/Http/Middleware/RedictToInstall.php:21

#48 App\Http\Middleware\RedictToInstall:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#47 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#46 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41

#45 Illuminate\Routing\Middleware\SubstituteBindings:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#44 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#43 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:68

#42 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#41 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#40 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49

#39 Illuminate\View\Middleware\ShareErrorsFromSession:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#38 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#37 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:63

#36 Illuminate\Session\Middleware\StartSession:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#35 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#34 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37

#33 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#32 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#31 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:66

#30 Illuminate\Cookie\Middleware\EncryptCookies:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#29 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#28 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104

#27 Illuminate\Pipeline\Pipeline:then in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php:667

#26 Illuminate\Routing\Router:runRouteWithinStack in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php:642

#25 Illuminate\Routing\Router:runRoute in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php:608

#24 Illuminate\Routing\Router:dispatchToRoute in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php:597

#23 Illuminate\Routing\Router:dispatch in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176

#22 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30

#21 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/app/Http/Middleware/BanIpCheck.php:36

#20 App\Http\Middleware\BanIpCheck:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#19 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#18 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/fideloper/proxy/src/TrustProxies.php:57

#17 Fideloper\Proxy\TrustProxies:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#16 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#15 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31

#14 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#12 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31

#11 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#10 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#9 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27

#8 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#6 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62

#5 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151

#4 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53

#3 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104

#2 Illuminate\Pipeline\Pipeline:then in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151

#1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /www/wwwroot/aabbcc.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116

#0 Illuminate\Foundation\Http\Kernel:handle in /www/wwwroot/aabbcc.com/public/index.php:55

不知道有没有这方面的迁移教程呢,折腾的比较头大

请先 登录 后评论

2 个回答

登峰 - 官方技术支持
擅长:tipask,php,服务器,网站建设

tipask的配置文件是根目录的 .env配置文件,看下是不是打包的时候没打进去。看错误信息是数据库配置信息错了。

请先 登录 后评论
混混

找朋友看了,删除了putenv函数,重新编译了env文件,现在正常了

请先 登录 后评论
  • 2 关注
  • 0 收藏,338 浏览
  • 混混 提出于 2020-04-22 23:33

相似问题