production.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'user1'@'localhost' (using password: YES) {"exception":"[object] (Doctrine\\DBAL\\Driver\\PDOException(code: 1045)
Please confirm you have done the following before posting your bug report:
- [ ] I have enabled debug mode
- [x ] I have read checked the Common Issues page
*Describe the bug I have configure snipeit on win 2016. I had to install composer dependencies using "composer install --no-dev --prefer-dist" instead the one indicated in the documentation. The issue is I am able to login to the DB with the user I created but laravel log is showing accessing denied and I think this is what is causing my defined host to fail to load
I checked the .env and virtual hosts and all looked good - to my eyes at least :)
#.env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=db_inventory
DB_USERNAME=user1
DB_PASSWORD=password1
DB_PREFIX=null
DB_DUMP_PATH='c:\wamp\bin\mysql\MYSQL8~1.18\bin'
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
#Virtual Hosts
<VirtualHost *:80> ServerName assets DocumentRoot "${INSTALL_DIR}/www/snipeit/public" <Directory "${INSTALL_DIR}/www/snipeit/"> Options +Indexes +Includes +FollowSymLinks +MultiViews AllowOverride All Require local
#Laravel.log:
2020-06-26 11:27:46] production.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'user1'@'localhost' (using password: YES) {"exception":"[object] (Doctrine\DBAL\Driver\PDOException(code: 1045): SQLSTATE[HY000] [1045] Access denied for user 'user1'@'localhost' (using password: YES) at C:\wamp\www\snipeit\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:31, PDOException(code: 1045): SQLSTATE[HY000] [1045] Access denied for user 'user1'@'localhost' (using password: YES) at C:\wamp\www\snipeit\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:27) [stacktrace] #0 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php(64): Doctrine\DBAL\Driver\PDOConnection->__construct('mysql:host=127....', 'user1', 'password1', Array) #1 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connectors\Connector.php(43): Illuminate\Database\Connectors\Connector->createPdoConnection('mysql:host=127....', 'user1', 'password1', Array) #2 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connectors\MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=127....', Array, Array) #3 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connectors\ConnectionFactory.php(183): Illuminate\Database\Connectors\MySqlConnector->connect(Array) #4 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() #5 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(915): call_user_func(Object(Closure)) #6 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(940): Illuminate\Database\Connection->getPdo() #7 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(399): Illuminate\Database\Connection->getReadPdo() #8 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(325): Illuminate\Database\Connection->getPdoForSelect(true) #9 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(657): Illuminate\Database\Connection->Illuminate\Database\{closure}('select * from i...', Array) #10 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(624): Illuminate\Database\Connection->runQueryCallback('select * from i...', Array, Object(Closure)) #11 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Connection.php(333): Illuminate\Database\Connection->run('select * from i...', Array, Object(Closure)) #12 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Database\Schema\MySqlBuilder.php(18): Illuminate\Database\Connection->select('select * from i...', Array) #13 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php(221): Illuminate\Database\Schema\MySqlBuilder->hasTable('settings') #14 C:\wamp\www\snipeit\app\Models\Setting.php(53): Illuminate\Support\Facades\Facade::__callStatic('hasTable', Array) #15 C:\wamp\www\snipeit\app\Providers\SettingsServiceProvider.php(34): App\Models\Setting::getSettings() #16 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\View\Concerns\ManagesEvents.php(164): App\Providers\SettingsServiceProvider->App\Providers\{closure}(Object(Illuminate\View\View)) #17 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php(347): Illuminate\View\Factory->Illuminate\View\Concerns\{closure}('composing: erro...', Array) #18 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Events\Dispatcher.php(200): Illuminate\Events\Dispatcher->Illuminate\Events\{closure}('composing: erro...', Array) #19 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\View\Concerns\ManagesEvents.php(179): Illuminate\Events\Dispatcher->dispatch('composing: erro...', Array) #20 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\View\View.php(118): Illuminate\View\Factory->callComposer(Object(Illuminate\View\View)) #21 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\View\View.php(85): Illuminate\View\View->renderContents() #22 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Http\Response.php(42): Illuminate\View\View->render() #23 C:\wamp\www\snipeit\vendor\symfony\http-foundation\Response.php(206): Illuminate\Http\Response->setContent(Object(Illuminate\View\View)) #24 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Routing\ResponseFactory.php(55): Symfony\Component\HttpFoundation\Response->__construct(Object(Illuminate\View\View), 500, Array) #25 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Routing\ResponseFactory.php(69): Illuminate\Routing\ResponseFactory->make(Object(Illuminate\View\View), 500, Array) #26 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(403): Illuminate\Routing\ResponseFactory->view('errors::500', Array, 500, Array) #27 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(295): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException)) #28 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Foundation\Exceptions\Handler.php(187): Illuminate\Foundation\Exceptions\Handler->prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpException)) #29 C:\wamp\www\snipeit\app\Exceptions\Handler.php(93): Illuminate\Foundation\Exceptions\Handler->render(Object(Illuminate\Http\Request), Object(Symfony\Component\Debug\Exception\FatalErrorException)) #30 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(112): App\Exceptions\Handler->render(Object(Illuminate\Http\Request), Object(Symfony\Component\Debug\Exception\FatalErrorException)) #31 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(89): Illuminate\Foundation\Bootstrap\HandleExceptions->renderHttpResponse(Object(Symfony\Component\Debug\Exception\FatalErrorException)) #32 C:\wamp\www\snipeit\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\HandleExceptions.php(123): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(Symfony\Component\Debug\Exception\FatalErrorException)) #33 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown() #34 {main}
To Reproduce Steps to reproduce the behavior:
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Server (please complete the following information):
- Snipe-IT Version : 4.9.3
- OS: [e.g. Ubuntu, CentOS]: Windows 2016
- Web Server: [e.g. Apache, IIS]: Apache 2.4.41
- PHP Version 7.2.31
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Error Messages
- WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error: xxx is currently unable to handle this request. HTTP ERROR 500
- If a stacktrace is provided in the error, include that too.
- Any errors that appear in your browser's error console.
- Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
- Include any additional information you can find in
storage/logsand your webserver's logs.
Additional context
- Is this a fresh install or an upgrade? Fresh install
- What OS and web server you're running Snipe-IT on Windows 2016 - Apache 2.4.41
- What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
- Include what you've done so far in the installation, and if you got any error messages along the way.
- Indicate whether or not you've manually edited any data directly in the database
Add any other context about the problem here.
Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.
Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail. This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!
This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.