On a windows XP machine, with MySQl server and a livecode stack connecting to the mysql server, what is the best :
to use "localhost" or "127.0.0.1" ?
Or there is absolutely no difference ?
Good practice : localhost or 127.0.0.1 ?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Good practice : localhost or 127.0.0.1 ?
There's *almost* no difference. The "localhost" designation will use the hosts file on your computer to resolve that and come up with 127.0.0.1, so in that case you get the same result. However, you could edit your hosts file to redirect localhost somewhere else (I can't think of a use case for this, but just sayin') and then you'd get a different result. There are also some malware apps floating around that rewrite your hosts file and cause all kinds of havoc until you fix things up. If your computer gets messed up this way you'll probably have bigger problems to worry about than whether you should use one designation or the other.
So basically there's no difference and you can use either one. Note, though, that you can't mix them in LiveCode scripts: if you open a port to "localhost" and then try to access it as "127.0.0.1" it won't work - you have to be consistent.
So basically there's no difference and you can use either one. Note, though, that you can't mix them in LiveCode scripts: if you open a port to "localhost" and then try to access it as "127.0.0.1" it won't work - you have to be consistent.