Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I get this when I execute a PHP script to query the DB. Godaddy person was no help at all. I access this same DB with .NET apps and with MySql Workbench.


Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user 'mystrainfamily'@'184.168.27.82' (using password: YES) in D:\Hosting\2451228\html\bobbystrain\Strains\php\scripts\connect.php on line 15

What I have tried:

I talked to Godaddy rep. No help. This is typical response.
Posted
Comments
Mohibur Rashid 4-Jun-19 18:20pm    
Do you think you use the same host?
If you connect with workbench with localhost and trying 184.168.27.82 then your php script will fail.

How have you stored your password in the script?
Is it ini file or coded in the php script. If coded in the php script and your password has any special character that modify literal string, such as '$', '\' will cause different password.
DerekT-P 5-Jun-19 11:14am    
You say you can connect with .Net apps; are they running on the server (and therefore "local") or remote? When connecting, are you explicitly using username "mystrainfamily@184.168.27.82" or just "mystrainfamily"...? Check that user mystrainfamily has rights to connect from any server, not just from 184.168.27.82. Finally MySql has a couple of different password security protocols (sorry, can't remember the terminology right now); make sure your password is using the correct encryption for your connector. I know that's a bit vague but easy enough to google for.
BobbyStrain 5-Jun-19 12:25pm    
The .NET apps are on the server and on my desktop. And no problem. I am using mystrainfamily for the username. My local PHP running on Apache gives the same error message, but, of course, a different IP address when I try to connect to the database on Godaddy. The connection to my local DB works fine. So I conclude that there is something different about Godaddy. Godaddy uses PHP 5.x and my PHP local install is 7.x. But the scripts are the same. I doubt I will get any help from Godaddy. My local Workbench connects to the Godaddy database OK, too. Using the same credentials.
DerekT-P 5-Jun-19 16:11pm    
can you post the php code where you're trying to do the connect?
BobbyStrain 5-Jun-19 16:31pm    
Here is the code for the connection.

$database_host = "mystrainfamily.db.1234567.hostedresource.com";
$username = "mystrainfamily";
$password = "Wxyz@";
$database_name = "mystrainfamily";


$con=mysqli_connect($database_host, $username, $password, $database_name)
or die("Error connecting to database: " .
mysqli_connect_error() . "");

echo "Connected to MySQL!";

mysqli_select_db($con, $database_name)
or die("Error selecting the database mystrainfamily: " .
mysqli_error() . "");

echo "Connected to MySQL, using database mystrainfamily.";

1 solution

recently godaddy is stopped accessing of mysql db outside IP (direct access db), once we have approched the godaddy they will not respond the query directly and the technical people also is not able to understand the requirement.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900