How do I connect to a remote MYSQL database? |
Site Admin
|
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 |
|
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. |
||||||||||||
|
Site Admin
|
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 |
How do I connect to a remote MYSQL database? |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by