dimanche 23 juin 2019

Error while connecting to Mysql Database ::SQLSTATE[28000] [1045] Access denied for user 'acknoxmv_acn'@'localhost' (using password: YES)

I have tried all the solutions for the connection. My database users exist. When i tried connecting using the following code it get connected(by creating test.php file and calling it):

<?php
$servername = "localhost";
$username = "acknoxmv_acn";
$password = "mysecrete";

// Create connection
$conn = new mysqli($servername, $username, $password,'acknoxmv_acn');

// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
?> 

but on trying same username and password with laravel .env file it gives error. I have tried all the solutions previosly available on internet.

.env file snap is as below

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:AYMzhMirrHPY3gkKv5Z6JqnSJAscsSxFp6+nW4mPyqI=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=acknoxmv_acn
DB_USERNAME=acknoxmv_acn
DB_PASSWORD=mysecrete

My code is working well in my pc i.e. using xampp. Now i am trying to test it on bigrock cloud server. My database name and user name is same.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire