if you are using default xamp user/pass remove the "." from password, there isnt one, its just blank with username "root"
Make:auth logging in connection refused to MySQL DB
Hey Guys,
I'm new tot Laravel, and I'm trying out some stuff. Currently I'm watching Laravel 5.4 From Scratch, and I'm trying to use artisan make:auth. After using the command it creates the views, etc.
But when I'm trying to connect to the DB it gives the following error.
PDOException in Connector.php line 68:
SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.
I'm tunneling the remote DB to my localhost. I also configured my .env file
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=4444
DB_DATABASE=DBname
DB_USERNAME=Username
DB_PASSWORD=Key
I forward the DB to port 4444. FYI I'm using XAMPP to create a localhost as server and run my Laravel project on it.
The weird thing is that the details of the error are.
in Connector.php line 68
at PDO->__construct('mysql:host=127.0.0.1;port=3306;dbname=blog', 'root', '', array(0, 2, 0, false, false)) in Connector.php line 68
at Connector->createPdoConnection('mysql:host=127.0.0.1;port=3306;dbname=blog', 'root', '', array(0, 2, 0, false, false)) in Connector.php line 43
at Connector->createConnection('mysql:host=127.0.0.1;port=3306;dbname=blog', array('driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'blog', 'username' => 'root', 'password' => '', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => null, 'name' => 'mysql'), array(0, 2, 0, false, false)) in MySqlConnector.php line 24
at MySqlConnector->connect(array('driver' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'blog', 'username' => 'root', 'password' => '', 'charset' => 'utf8mb4', 'collation' => 'utf8mb4_unicode_ci', 'prefix' => '', 'strict' => true, 'engine' => null, 'name' => 'mysql')) in ConnectionFactory.php line 183
I don't get why it uses 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'database' => 'blog', 'username' => 'root', 'password' => ''.
The connection works when i use artisan to insert data to the database. Could it be because of XAMPP ? Am I doing something wrong with Laravel ?
Hi Guys,
I solved it. I changed my MySQL port to 4444. Afterwards I restarted xampp and it worked.
Please or to participate in this conversation.