Current time: 04-16-2014, 08:59 AM Hello There, Guest! (LoginRegister)

Post Reply 
DH hosted PHP Can't Access DH Hosted MySQL
04-07-2012, 03:26 PM
Post: #1
DH hosted PHP Can't Access DH Hosted MySQL
Hi all: While I've been programming for quite a while, this is my first dive into the world of PHP and web based programming (I've been a local client-server guy on the Microsoft platform).

My problem relates to allowing a pre-defined user in a DH hosted MySQL DB to access the DB from a DH hosed PHP script.

The following is the error I am receiving and the code:

Error: Access denied for user 'myuser'@'%' to database 'mydatabase'
Code:
//Connect to the Database
$con = mysql_connect('my.database.host', 'myuser', 'mypassword') ;
if (!con){
die ('Can\'t execute mysql_connect : ' . mysql_error());
}

// failing above

$db_selected = mysql_select_db('mydatabase', $con);
if (!$db_selected) {
die ('Can\'t use mysql_select_db : ' . mysql_error());
}



In the "allowable hosts" for this user, I am specifying %

Weird thing is, I can connect to the table and DB using a third party SQL tool on the desktop. I would think speaking internally between DH servers would be easier!

Oh well. Any help would be appreciated!

Thanks!
Tom
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
DH hosted PHP Can't Access DH Hosted MySQL - alpharisk - 04-07-2012 03:26 PM

Forum Jump: