Keep in mind, that "localhost" is special name. It always yield to the same server, where Apache is running. On your local PC, "localhost" is your local PC, on the hosting server "www.yl-technology.com", "localhost" is the hosting server "www.yl-technology.com".

So if you use "localhost" on "www.yl-technology.com", there must be running a MySQL Server on "www.yl-technology.com" which listens to "localhost". This is of course different to the MySQL Server on your local PC.