# Warning when calling db

**URL:** <https://www.phphelp.com/t/warning-when-calling-db/32691>\
**Category:** MySQL database\
**Created:** [October 20, 2020, 7:31am UTC](https://www.phphelp.com/t/warning-when-calling-db/32691 "2020-10-20T07:31:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebenist](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@ebenist](https://www.phphelp.com/u/ebenist)\
**Post date:** [October 20, 2020, 7:31am UTC](https://www.phphelp.com/t/warning-when-calling-db/32691/1 "2020-10-20T07:31:32Z")

</div>

I have built a new site witout knowledge and got this when connecting db:

**Warning** : mysqli::\_\_construct(): (HY000/1044): Access denied for user ‘ringstac\_chefen’@‘localhost’ to database ‘ringstac\_pris’ in **/home/ringstac/public\_html/lasyr.php** on line **78**  
Connection failed: Access denied for user ‘ringstac\_chefen’@‘localhost’ to database ‘ringstac\_pris’

Checked db name and server, pw, user etc but what is wrong? Is there a permission problem?

---

<div class="post-metadata">

**Author:** ![skawid](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/bbe5ce/32.png) [@skawid](https://www.phphelp.com/u/skawid)\
**Post date:** [October 20, 2020, 8:32am UTC](https://www.phphelp.com/t/warning-when-calling-db/32691/2 "2020-10-20T08:32:16Z")

</div>

> [@ebenist](#):
>
> Is there a permission problem?

Yes. Either the username and / or password are incorrect, or the user does not have access to that database.

---

<div class="post-metadata">

**Author:** ![ebenist](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@ebenist](https://www.phphelp.com/u/ebenist)\
**Post date:** [October 20, 2020, 8:53am UTC](https://www.phphelp.com/t/warning-when-calling-db/32691/3 "2020-10-20T08:53:37Z")

</div>

Hi, username, pw and all is ok and user is set as current user on db. is there any other permission i miss?  
Code:

$servername = “localhost”;  
$username = “ringstac\_chefen”;  
$password = " xxxxx where xxxx is my pw";  
$dbname = “ringstac\_pris”;

// Create connection  
$conn = new mysqli($servername, $username, $password, $dbname);  
// Check connection  
if ($conn-\>connect\_error) {  
die("Connection failed: " . $conn-\>connect\_error);

---

<div class="post-metadata">

**Author:** ![ebenist](https://www.phphelp.com/letter_avatar_proxy/v4/letter/e/3e96dc/32.png) [@ebenist](https://www.phphelp.com/u/ebenist)\
**Post date:** [October 20, 2020, 8:55am UTC](https://www.phphelp.com/t/warning-when-calling-db/32691/4 "2020-10-20T08:55:31Z")

</div>

Ohhh, just found the “priviliges” for user. Everything is working - GREAT!
