Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mysql Remote Connect
#1
Guys, I am trying to connect to my MYSQL DB from a remote server. From my local server this works fine for all my Domains

$DBTYPE = 'mysql';
$DBHOST = 'localhost';
$DBUSER = 'dbuser';
$DBPASSWORD = 'dbpassword';
$DBNAME = 'somedb';
// End Configuration

The remote script will be using same configuration info as above. It is just a bridge between one CMS script and another so when users sign up in one, they are automatically signed up in the other.

All is fine but need to kow how to connect to the DB since the two scripts are on two different servers.

This is what I ned to change
$DBHOST = 'localhost';

I have tried
$DBHOST = 'http://mydomain.com/mysql';
$DBHOST = 'http://mydomain.com/localhost';
$DBHOST = 'http://mysql.mydomain.com';

Last one of course needs a DNS change to work
I guess I am now finding out there is more to this than just the URL.

How can I accomplish the above?

Restored from old drupal forum, for user uid:2896 username:Netlink
You may reset your password to access your new account here.
Reply
#2
lets say, your script in ip A, (for ex, 88.222.33.44)
and your mysql server is in ip B,
A wants to connect to B, (A->B)

use in your script,(or config.php in ehcp dir)
<code>$dbhost='B'

then,
in your mysql server at B , go to phpmyadmin, login as root,
go to privileges (Yetkiler), add a new user,
while adding, set hostname as 'A', add new user. use same username and password as original.

this way, any script in A will be able to connect to server at B.

you may need following too:
in B, in console, open file /etc/mysql/my.cnf

replace line
<code>bind-address = 127.0.0.1
to
<code>bind-address = 127.0.0.1, B (ipofyourserver)

then, restart mysql
<code>/etc/init.d/mysql restart


keep in mind that, you need your port 3306 open toward your server.


Restored from old drupal forum, for user uid:2896 username:Netlink
You may reset your password to access your new account here.
Reply
#3
Thanks for your response.

Will try above when I get back to my server. I may run into some issues with port 3306.

I remember opening that port for my other Radio server. I run a Radio Station on that server and my broadcasting software needs that port open so I have it open on my router but directed to the other server.

Am I able to use a different port or will this complicate things too much?

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#4
no, i dont think it is complicated,

just you need to set it in mysql configs.
mysql is using 3306 by default, but you can change it with little effort, i think.



Restored from old drupal forum, for user uid:2896 username:Netlink
You may reset your password to access your new account here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping