Computer >> Computer tutorials >  >> Programming >> MySQL

Difference between localhost and 127.0.0.1?


The main difference between localhost and 127.0.0.1 is that there is a need of look up table. In localhost, we need to look up a table somewhere.

The address 127.0.0.1 can be converted into an IP address directly with the help of intelligent software. In this, there is no need to do look up table at all.

Therefore, localhost is easy to remember but it is hard to remember an IP address. We can go for the following since its easy −

https://localhost

The following is hard to remember −

https://127.0.0.1

However, the IP address 127.0.0.1 is faster in comparison to https://localhost