Question:
Uploading PHP site to GoDaddy. Need help with conn to PHPmyadmin database?
viintageecstasy
2009-08-24 11:19:34 UTC
I have only set up PHP websites on a local server. I'm not sure how to go about this. I made a PHP website with dreamweaver and XAMPP. I made a Database in the godaddy website named "mdcphotoclub". Under that database I have a table called "user", where there are three fields, "host", "username", and "password". Under host I put to godaddy IP, under "username" I put "root", and under "password" I put "root".

In the main folder of my website I have a folder called "Connections", which has a PHP file called "connPhotoClub", and in here I have this:

# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connPhotoClub = "10.6.186.3";
$database_connPhotoClub = "mdcphotoclub";
$username_connPhotoClub = "root";
$password_connPhotoClub = "root";
$connPhotoClub = mysql_pconnect($hostname_connPhotoClub,

$username_connPhotoClub, $password_connPhotoClub) or

trigger_error(mysql_error(),E_USER_ERROR);
?>

Now when I try to access the website, this error comes up:

Warning: mysql_pconnect(): Access denied for user 'root'@'208.109.181.208' (using password: YES) in /home/content/m/d/c/mdcphotoclub/html/Connections/connPhotoClub.php on line 9

Fatal error: Access denied for user 'root'@'208.109.181.208' (using password: YES) in /home/content/m/d/c/mdcphotoclub/html/Connections/connPhotoClub.php on line 9


Any suggestions?
Four answers:
Will
2009-08-24 11:33:18 UTC
Did you register with the site? It's blocking your IP address from accessing the site. Try making a username and password (signing up for) your website. After that try logging in. There's probably something wrong in the code connecting to the database, you seem to have set it up correctly.



-Billy
2016-05-27 05:08:13 UTC
I don't know exactly how GoDaddy works but I would say its not much different from my host. What you need to do is go into your Cpanel and look for the database section, then you need to go to mysql databases or whatever database you use and create a user, you then use that username and password to connect to the database and most often then not the host for your database is 'localhost' not the ip address that you would use to navigate to your website. You will also need to create a database and assign a users priveledges to it, this can all be done through the mysql databases section in your Cpanel. I also would not use mysql_pconnect as the connection will not close and that can leave you vulnerable to attacks. The way I would write my script is: Then in mysql_query I would always add my connection variable like this: mysql_query($sql, $connect); I've never had any problems with this and I hope it can help you out.
Kavrocks
2009-08-24 11:44:39 UTC
I don't know exactly how GoDaddy works but I would say its not much different from my host. What you need to do is go into your Cpanel and look for the database section, then you need to go to mysql databases or whatever database you use and create a user, you then use that username and password to connect to the database and most often then not the host for your database is 'localhost' not the ip address that you would use to navigate to your website. You will also need to create a database and assign a users priveledges to it, this can all be done through the mysql databases section in your Cpanel.



I also would not use mysql_pconnect as the connection will not close and that can leave you vulnerable to attacks.



The way I would write my script is:




$host = 'localhost';

&user = 'username';

$pass = 'password';



$connect = mysql_connect($host, $user, $pass) or die(mysql_error());

if(!$connect) {

echo 'There was an error connecting to the database.';

}else {

echo 'Database connection successful';

}

?>



Then in mysql_query I would always add my connection variable like this: mysql_query($sql, $connect);

I've never had any problems with this and I hope it can help you out.
2014-08-01 07:44:45 UTC
You can download PHPmyadmin here http://bitly.com/1no63fv

It's a good free solution.

Good Bye


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...