I've followed good tutorials on the web and I do make, I've made step by step its advices and I don't achive to conect my laravel framework to XAMPP.. I don't have idea what's going on.. I've written down the .env and config/database.php with the same data configurations (DB_DATABASE= styde_curso, DB_USERNAME= root, and DB_PASSWORD= ).
.env
APP_NAME=Prueba
APP_ENV=local
APP_KEY=base64:MWU6YadaT17Ga1m3hrtOQqYq6pIwOgrNWQe+mJazyw0=
APP_DEBUG=true
APP_URL=homestead.test
LOG_CHANNEL=stack
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=styde_curso
DB_USERNAME=root
DB_PASSWORD=
config/database.php
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'styde_curso'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => true,
'engine' => null,
],
Although I'd applied "php artisan config:clear" I'm getting the same result "ERROR" I've copied the error that git hub notices me:
vagrant@homestead:~/code/Prueba$ php artisan config:clear Configuration cache cleared! vagrant@homestead:~/code/Prueba$ php artisan migrate
Illuminate\Database\QueryException : SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = styde_curso and table_name = migrations)
at
/home/vagrant/code/Prueba/vendor/laravel/framework/src/Illuminate/Database/Connection.php: 664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
666| );
667| }
668|
Exception trace:
1 PDOException::("SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)") /home/vagrant/code/Prueba/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php : 68
2
PDO::__construct("mysql:host=localhost;port=3306;dbname=styde_curso", "root", "", []) /home/vagrant/code/Prueba/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php : 68
I'll wait your help or whomever can help me.. Thanx.
root
and without password like you have in config? – Sérgio Reis