antonioribeiro / antonioribeiro/tracker

PDOException::("SQLSTATE[HY000] [1045] Access denied for user ''@'localhost' (using password: NO)")

Open
#520 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
2.9k
Forks
594
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
```
//database.php inside connections

'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
....
'tracker' => [
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'trackers', //created different db since its mentioned
'strict' => false, // to avoid problems on some MySQL installs
],
```
and my env file
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravelwebsite
DB_USERNAME=root
DB_PASSWORD=
```

**To Reproduce**
Steps to reproduce the behavior:
1. Enter command php artisan tracker:tables ---------> //success
2. then php artisan migrate
4. See error

**Screenshots**

![image](https://user-images.githubusercontent.com/28777412/97694685-f9b37080-1ac8-11eb-88fb-63d800d66663.png)

**System**
- OS: Windows 10
- Browser chrome

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `database.php` connection definitions and the provided `.env` values, then run `php artisan tracker:tables` followed by `php artisan migrate` to compare the reported behavior. The issue does not identify a code change or acceptance condition, so completion would require establishing the cause of the MySQL access-denied error and agreeing on the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, mysql, php
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.