I have bought the hosting and now I have successfully created a database and new user and I have enter phpmyadmin from cPanel to create database.

Now everything is done. But where can I find information's about my server name, port and so on...

When I am in phpmyadmin in left upper corner I can see localhost. But this is not localhost I have a server hosting.

Thank you and please give me some info.


Actually when using hosting management software like cPanel, it installs MySQL with default and commonly used configurations:

  • MySQL host = 'localhost'
  • MySQL port = '3306'
  • MySQL User = 'cpanelusername_mysqluser' [1]
  • MySQL password = 'password' [2]
  • MySQL database = 'cpanelusername_database' [3]

More explanations about the host address:

  • If your script or program is going to be accessing the hosted database locally, meaning script and database are on same account, the server/host address will always be: localhost, just like that, lowercase and one word.
  • If you are using remote database management software, the server would either be your domain name: example.com or the shared server IP (preferred choice). The shared server IP is found in the Stats section of the cPanel on left side.

Remote database connection setup:

  • Databases in cPanel can be accessed remotely, or by other web servers or from your home computer to manage the database with MySQL software like Workbench or Dreamweaver.
  • To specify remote servers able to access MySQL databases on your server:

    1. Login to cPanel.
    2. Locate Remote MySQL Icon under Databases.
    3. Type your public IP or server IP address into the Add Access Host field.
  • To disallow a host from accessing databases on your server:

    1. Click the X icon next to the IP address.
    2. If you are sure you wish to prevent the server from accessing your databases, click Yes.

[1] Your cPanel username followed by an underscore '_' followed by your MySQL user you have configured in cPanel

[2] Your MySQL password you have configured in cPanel

[3] Your cPanel username followed by an underscore '_' followed by you MySQL database you have configured in cPanel

  • That's what I wanted to hear :) Let me try May 29 '12 at 14:50
  • how can I put localhost? Should I put a IP adress or something? For example I am connecting trough the c# to my server. Where can I see IP adress of the database? in php admin I have web server section and I see some IP number but there is a "cpsrvd" text before it. Is this the right IP? May 29 '12 at 14:57
  • hmm I have tried to connect from mysql workbench and I have entered the info of shared ip in IP spot for it port 3306 my username and pass and can't connect it May 29 '12 at 15:02
  • I can write the shared IP from server then I can access it remotely from any PC if I have understood you? May 29 '12 at 15:18
  • Yes, you have to first authorize your home machine IP and then write the shared IP in your program to access the remote database.
    – fsenart
    May 29 '12 at 15:19

To clear up the localhost thing -- we almost always use localhost to connect to the MySQL server, because it's a separate service on the SAME MACHINE. (Think of it as having a washing machine and a dryer; you put the clean but wet clothing in the dryer which is in the same house (localhost) as the other machine. You don't need to specify your house's address to get the clothing into the dryer. The purpose of this is to save bandwidth, and deliver the fastest speed possible. Why waste time routing outside the server and then back into it?

The standard webserver port is port 80, SSL is 443, FTP is 21, SSH is 22, MySQL is 3306, etc. You would log into the cPanel, and somewhere in the menus or on the right or left column, is the details about the IP address of the server. If you are managing your own DNS records vs. using the system built into cPanel, then you will need to specify where they are located.

It sounds like in your situation, that you registered a domain name to use with the web hosting, and should use that to connect to your site. Server name (if you mean the physical server name) is not important to you, since it's likely on a shared hosting account, where one server can serve a multitude of various peoples' websites.

If you need answers to specific questions regarding cPanel, consult the FAQ or helpdocs: http://docs.cpanel.net/

Else, try to contact your hosting provider. Most quality-webhosts have a support-ticket system, and are generally quick in responding.

If you have any technical questions, feel free to post them and (we) will try our best to assist you.

  • hi, yes it is a web hosting, I see a tons of info in the cpanel column such as shared IP adress, server name ( which is wierd, without http, I only see name something as cpanel-... ) Then port should be 3306 for mysql? Can I ping this from cmd? So I can check if it is working? Or I can use mysql workbench... May 29 '12 at 14:48
  • MySQL should be configured already with cPanel. Don't mess with any of the technical settings (apart from making or editing databases with the database manager or PHPMyAdmin) I was just saying that the localhost part is nothing to worry about, and that it's how most servers are set up. You want to just point your domain to your web hosting account, if not already. If you bought the domain WITH hosting, it should be set up already.
    – ionFish
    May 29 '12 at 21:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.