|
NYDAz
|
 |
« on: November 05, 2009, 08:56:17 AM » |
|
I'm wondering if it's possible to have a script on host 1 ! and a database on host 2 ! and to make them work together ! I'm trying but the script it's giving me an error about how he could not recognize the host 2 ! PS : If your wondering why I don't keep them together, it's because for host 1 i have only username/password for FTP ! 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
perkiset
|
 |
« Reply #1 on: November 05, 2009, 09:33:10 AM » |
|
Absolutely, it's done all the time and, in fact, designed to be that way.
When you connect, you pass a host or IP, username, password and database name. If it's not being "recognized" at that point then perhaps server 1 is not resolving your hostname correctly. But if it's simply that it won't connect, then it's more likely a permissions problem. MySQL is really strong about permissions and just because a login (username) has full availability on the local host (127.0.0.1) doesn't mean it can do anything at all from another machine.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
NYDAz
|
 |
« Reply #2 on: November 05, 2009, 09:48:41 AM » |
|
Absolutely, it's done all the time and, in fact, designed to be that way.
When you connect, you pass a host or IP, username, password and database name. If it's not being "recognized" at that point then perhaps server 1 is not resolving your hostname correctly. But if it's simply that it won't connect, then it's more likely a permissions problem. MySQL is really strong about permissions and just because a login (username) has full availability on the local host (127.0.0.1) doesn't mean it can do anything at all from another machine.
Exactly ... that's what I'm thinking too, perk ! For my example I illustrate the following : - host 1 (script) - host 2 (sql sb) - when I try to connect host 1 to host 2 i use : username, password & host (host is something like nydaz.sqlawebhostingcompany.com) It's obivioius it should work ... I'll take another look in the script ! But for the most hosts the host is something like localhost ! How can we know what the ip for that or something like that ? 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
perkiset
|
 |
« Reply #3 on: November 05, 2009, 10:07:31 AM » |
|
"localhost" literally means, "on this machine." It's usually a pseudo-DNS name for 127.0.0.1. You cannot use that to talk to another machine, in any case.
It's just a little more complicated than, "what is the address of this machine." If a machine has multiple addresses, then you may or may not have permissions on any one of them. Can you not call your ISP and simply ask? "What address should I use to address my database from the outside world?" Bear in mind that, as I said above, you may not even HAVE perms to talk to the DB from off that box ... so you'll probably wind up talking to your ISP in any case.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
NYDAz
|
 |
« Reply #4 on: November 05, 2009, 10:08:35 AM » |
|
Thanks old man 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|
perkiset
|
 |
« Reply #5 on: November 05, 2009, 10:14:02 AM » |
|
 What'd I do to deserve that? ? ? BTW, get off my lawn you whippersnappers.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
vsloathe
|
 |
« Reply #6 on: November 05, 2009, 10:45:12 AM » |
|
edit my.cnf Find where it says [mysqld] and underneath you should see "bind address". make it your external IP. Not localhost or 127.0.0.x run a query like GRANT ALL PRIVILEGES ON *.* TO '[user]'@'[ip]' IDENTIFIED BY '[password]' where [user] is the username you want to use, [ip] is the ip address of the server your script is running on (you can enable access from anywhere by using '%' instead, but if you do this you need to toss your computer out the window and never come near another computer again, as it's akin to clicking random links and opening random attachments in emails from strangers) and [password] is the password. should be all set then. update your script to use the IP of your DB server as the host, and that username and password. Wait til you get to try to setup 3-way replication 
|
|
|
|
|
Logged
|
hai
|
|
|
|
nutballs
|
 |
« Reply #7 on: November 05, 2009, 12:56:13 PM » |
|
the big blockade is usually permission on the database side. MYsql, by default, does not allow external connections to anything. Thats what V's stuff above
|
|
|
|
|
Logged
|
I could eat a bowl of Alphabet Soup and shit a better argument than that.
|
|
|
|
perkiset
|
 |
« Reply #8 on: November 05, 2009, 01:05:57 PM » |
|
... provided he has root enough access to GRANT ALL. if he doesn't have GRANT as a perm then he'll not be able to do anything.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
serialnoob
|
 |
« Reply #9 on: November 06, 2009, 08:49:20 PM » |
|
Assuming shared hosts and cpanel, the mysql admin in cp can allow specific or range of IPs, access to mysql, provided "granting" as above.
However, it presumably provides a "possible access" to all the other users on this IP, relying only of the mysql password as security. Right?
The alternative I ended up using: running a script on host 1 where the mysql resides, triggered from host 2 with access via .htaccess pass.
I have always wondered how the security issue compare in these 2 cases, anyone?
|
|
|
|
|
Logged
|
Success consists of going from failure to failure without loss of enthusiasm - Winston Churchill
|
|
|
|
vsloathe
|
 |
« Reply #10 on: November 09, 2009, 07:23:49 AM » |
|
Neither one is secure, so it doesn't really matter. Depends on how paranoid you are. 90% of people don't need to worry about sending plain text over the wire.
|
|
|
|
|
Logged
|
hai
|
|
|
|
serialnoob
|
 |
« Reply #11 on: November 09, 2009, 06:32:42 PM » |
|
Neither one is secure, so it doesn't really matter. Depends on how paranoid you are. 90% of people don't need to worry about sending plain text over the wire.
Very paranoid, considering it would probably take you a few seconds to get into these boxes! Although I doubt you would be impressed, or may be that is why you would not bother in the first place, just because it is plain text. Then what are the not "plain text" someone would go after?
|
|
|
|
|
Logged
|
Success consists of going from failure to failure without loss of enthusiasm - Winston Churchill
|
|
|
|
vsloathe
|
 |
« Reply #12 on: November 10, 2009, 06:47:26 AM » |
|
You could use SSL (HTTPS) or a VPN (usually SSH).
The chances of your particular mySQL creds getting sniffed are very low unless someone is specifically listening and knows where and when to listen. Like I said, depends on how paranoid you are. I'm not terribly worried about random strangers finding unencrypted packets I've sent, more worried about governments or other large organizations.
|
|
|
|
|
Logged
|
hai
|
|
|
|
perkiset
|
 |
« Reply #13 on: November 10, 2009, 08:20:48 AM » |
|
 It's not your average creep that has the kind of time necessary to hunt you, it's a government with near limitless capability to sniff every packet going across a spine and recombine into a stream when they feel like it. Contrary to popular myth, sniffing your personal traffic from somewhere other than physically at your ISP's or backyard is difficult enough to keep most boneheads from being able to do it.
|
|
|
|
|
Logged
|
It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
|
|
|
|
NYDAz
|
 |
« Reply #14 on: November 10, 2009, 08:40:03 AM » |
|
all went good ! host 2 wouldn't let me to connect remote through my db ! Finded another host 2 with remote control ! Contact the support departament ! They've put my ip (host1) in their firewall (added exception) so I can connect remote ! Everything is running very smooth now ! 
|
|
|
|
|
Logged
|
I'm an educated fool, with money on my mind !
|
|
|
|