NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
How do I connect to a remote MYSQL database?


Joined: 21 Nov 2006
Posts: 2
Reply with quote
I normally use Dreamweaver for my web development work. However I am starting a very large project in PHP so I am currently evaluating a couple of PHP specific editors. I've been happy with what I've seen with PHPed and am about ready to make a purchase, although one problem remains which if I can't resolve will be a show stopper. I've tried to point of pulling my hair out to try and connect to the MYSQL database which resides on my hosted server.

If I try to connect to the database through PHPed, I get a log in error. The reason I have discovered is because even though I type in the login information as username and password, it changes my username string so that its, "username@myhomeiplocation" rather than simply username. Now I know its possible to make such a connection because I can do so in Dreamweaver with very little problem.

If someone can please show me how to make this same connection with PHPed, I'll immediately place my order.

Thanks
View user's profileFind all posts by blaiseSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Could you please provide more details on the problem? In particular, what error message did it show? Are you trying to connect using PHPED embedded DB client or you're trying to connect from your PHP script?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 21 Nov 2006
Posts: 2
Reply with quote
Hi dmitri, thanks for the reply. I'm trying to connect within the PHPed IDE. The steps taken were to go to "Accounts" create a new account to my remote MYSQL database (its on a web hosting account). When I open the Database client window and click on the account I created, it clocks for several minutes and then reports that it could not connect because my login information is not correct.

Let me give you a detailed example:

Lets say the site where my database is located is myserver, my user name is dbname, and my password is dbpassword. I've entered these values into the respective input boxes. The error message I get back is something to the effect of:

"Could not connect to database, invalid login using dbname@myhomeipaddress"

And that represents the entire problem. For some reason it is appending the "@myhomeipaddress" to the end of the user name that I typed into the user name box when I created the database client account within PHPed. If it did not append that value and simply sent "dbname" I'm thinking that it would work.

I would suspect that perhaps trying to make a remote connection to the database in this manner would not be possible, however I have no problem what so ever connecting to the same database using Dreamweaver. So I know its possible but apparently I either don't have the account in PHPed set up correctly or it does not support that functionality. I'm hoping it is a configuration issue.
View user's profileFind all posts by blaiseSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
As far as I understand, everything works as expected, except perhaps delay. Normally it would be few seconds or less.
From MySQL perspectives if you connect from a php script running on the same host is NOT the same as when you connect from a remote host (regardless using php or mysql console or whatever).
I'd recommend you to read manual related to GRANT sql command and let dbname@myhomeipaddress user to be logged in.

Alternatively, you may want to run SSH tunnel using putty ssh or cygwin ssh (latter is know to work good), and work using tunnel. In this case you'll need to set hostname -> localhost (in the account settings) and run tunnel using for example line below:
c:\cygwin\bin\ssh.exe -L localhost:3306:localhost:3306 myusername@myhostname
In this case mysql will recognize you as dbname@localhost .

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How do I connect to a remote MYSQL database?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic