Error -> Connect to remote MySqlDatabase
Moderator: General Moderators
Error -> Connect to remote MySqlDatabase
Hello,
I have a Mysql Database at a server with a lot of data in it.
Now I have another domain, but I want to access de DB at my other site to read the data. So I replaced Localhost with mydomain.
I used this line of code
$ie_conn = mysql_connect("www.mydomain.com", "user","Password");
The Error
Warning: Access denied for user: 'user@d31A4C67E.kabel.telenet.be'
Anyone Knows a solution ?
Thanks
I have a Mysql Database at a server with a lot of data in it.
Now I have another domain, but I want to access de DB at my other site to read the data. So I replaced Localhost with mydomain.
I used this line of code
$ie_conn = mysql_connect("www.mydomain.com", "user","Password");
The Error
Warning: Access denied for user: 'user@d31A4C67E.kabel.telenet.be'
Anyone Knows a solution ?
Thanks
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Make sure that the user is allowed to login from a remote location - check the Host column in the User table in the mysql database. If it says 'localhost' then you need to change it to either % or the IP address of the second server. You might also want to just create a new user that is only allowed from the second server's IP and give it limited privledges.
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Just a PHP script that takes a query as input, and then returns the results.
Code: Select all
if($_POST['uid']=='jkhsafib3d7'){ //do some kind of user check/login
$query = check_query($_POST['query']);
$result = mysql_query($query);
//print the results back to the user
}If you know C++ then PHP will be easy for you. Write some C++ code that posts data to a url on your server. Use a php script to update the database, and then return data back to your application in for form of an ini file or something.
Code: Select all
їwhos_online]
username
username2
username3
їhighestscores]
25112254
15224456
etc....-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
nobody said you have to do it unencryptedagtlewis wrote:You don't want your app remotely connecting to the database anyway, then anyone with a packet sniffer will have the username and password and could wreak havoc on it or create invalid entries, such as impossible high scores.
both, methods (mysql lib and http - php proxy) can use SSL
invalid entries can always be made, it's just a matter on how hard you want to make it not to happen....