Current time: 07-20-2017, 09:38 PM 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'
//Connect to the Database
$con = mysql_connect('', '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!

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: