Username is epiz_2783421
Access denied for user ‘epiz_27834217’@‘192.168.2.194’ (using password: YES)
I made a connection using the host name, username, and password to my databases. In localhost it worked well but here I am getting error message Access denied for user ‘epiz_********’@‘192.168.2.194’ (using password: YES) what could be the exact problem. The password is correct, the username is correct, host name is also correct. Please help am new to web development please share the FULL error message
Did you make sure all the credentials match the ones from your account client area?
1 Like
lovebug
February 4, 2021, 5:22pm
#3
Emmatruth:
@‘192.168.2.194
this is your local host name and will cause an issue, you will need to replace this with your infinityfree host name
check here How to setup a new MySQL Database - Docs - InfinityFree Forum for more information
2 Likes
They did match. Only that I didn’t include the database name in my config script intentending to do when I need a specific databases to use using the sqli_select_db
1 Like
lovebug
February 4, 2021, 5:48pm
#5
well thats great news, so its all sorted now
I wasnt any help lol but im glad you found the issue
Yeah the did. Should I post my config.php script?
lovebug
February 4, 2021, 5:49pm
#7
you can post anything you like here but just make sure you dont include the password
You really were of help. Without the direction I wouldn’t have come to know what I did
lovebug
February 4, 2021, 5:56pm
#9
no problem , im no expert for sure but I try to help where I can.
my business is dead right now with the lockdown mess so I have a bit of spare time on my hands and thought I would put it to good use helping out here
infinityfree have been so kind to give me free hosting and help me out when ive had issues that its only fair I try to return the love
thanks
2 Likes
<?php
$servername = "sql306.epizy.com";
$username = "epiz_27834217";
$password = "**********";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$mess= "Connected successfully";
?>
lovebug
February 4, 2021, 6:02pm
#11
heh im just off to learn mysql so I can understand that
btw if you highlight your code in the message editor and then click the preformatted text icon in the message editor top bar it’ll display nicely like this
<?php
$servername = "sql306.epizy.com";
$username = "epiz_27834217";
$password = "**********";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); }
$mess= "Connected successfully";
?>
This is the code causing connection problem. What should I have done?
Oxy
February 4, 2021, 6:14pm
#14
you miss database name
for conn.
Many websites use MySQL databases to store information and settings. However, there are some reasons why the connection to the database may fail. This article describes some commonly seen error messages when connecting to a database, as well as some...
you need 4 parameters
5 Likes
What I actually meen is that when testing this code on localhost with user root, password root it worked well but here it is not
lovebug
February 4, 2021, 6:21pm
#16
thanks oxydac you beat me to it
I was just checking here PHP: mysqli::__construct - Manual and noticed that
" dbname If provided will specify the default database to be used when performing queries."
4 Likes
Thanks for your help I got the point clearly now
Oxy
February 4, 2021, 6:49pm
#19
YW, good luck in further work
1 Like