Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mySQL Hostname?

Discussion in 'General Discussion' started by dyr, Apr 28, 2012.

  1. dyr

    dyr Registered

    Apr 27, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Website Owner
    Hi, I've set up a mySQL database for my site and have set the hostname to 'localhost'. I have set up php script such as register, login/logout, etc. I'd like the users information to be stored in the mySQL database I've specified. Will this work, even if the hostname for my site I set to 'localhost'? I always thought localhost meant only my computer will be able to use the codes?
    #1 dyr, Apr 28, 2012
    Last edited: Apr 29, 2012
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    Using "localhost" as the hostname in your script configuration is common. It tells the script that MySQL is hosted on the same server the script is uploaded to. Thus, database changes are made to the local MySQL server.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice