The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to access database?

Discussion in 'Database Discussions' started by kbun, Sep 4, 2009.

  1. kbun

    kbun Member

    Joined:
    Sep 4, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    hi all,

    i've tried to access my database that i've already created but it come with this
    error message

    could connect to the specified instance 2003


    Server Host: 'www.example.com'
    username: 'username'
    password: 'password'
    database: 'dbname'

    Please help!
    :confused:
     
  2. MattCurry

    MattCurry Well-Known Member

    Joined:
    Aug 18, 2009
    Messages:
    275
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Houston, Tx
    Database Access

    Kbun,

    I am sorry to hear that, well I would need a little bit of information before we could proceed. First, is this you trying to connect locally or remotely? If you are having issues with it remotely here is a link,http://forums.cpanel.net/f4/how-enable-mysql-remote-access-20984.html#post97521.

    However, if it is local that can be a different story. You would need to make sure that you have added that user to your database via the cPanel interface.

    This can be achieved as the user via : cPanel -> Databases -> MySQL Database


    I hope this is the information you need.

    Thank you,
    Matthew Curry
     
  3. kbun

    kbun Member

    Joined:
    Sep 4, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    How to access database

    I'm trying to remote access the database using MySQL Query Tool or using php code to access it.
    In my control panel i created database name 'testdb' and a user name 'testuser'
    i assigned full access control to this user.

    But, everytime i try to connect to the database server it's always failed.

    is it correct that i used www.mysite.com.au as server host?

    Please help.
    Jim
     
  4. kbun

    kbun Member

    Joined:
    Sep 4, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    This the error message when i try to connect to the database ..

    Warning: mysqli::mysqli() [mysqli.mysqli]: (00000/1130): Host 'ares.instanthosting.com.au' is not allowed to connect to this MySQL server in /home/fre47098/public_html/index.php on line 2
    Connect failed: Host 'ares.instanthosting.com.au' is not allowed to connect to this MySQL server
     
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Is this script that is giving this error on the same server as cPanel/WHM?
     
  6. kbun

    kbun Member

    Joined:
    Sep 4, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi,
    problem solved, i can connect my database now... :D

    THANKS A BUNCH....

    Jim
     
  7. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Some beginner configure tips for Cpanel based servers running MySQL:

    Except in more rare cases where the database might be a remote server,
    the server hostname to use in your scripts is almost always going to be
    named "localhost" so use that instead of "www.example.com" above.

    On cpanel systems, your database name and database username are both
    prefixed with your main Cpanel account login so if your login name to
    your cpanel account were "james" then the above example you wrote
    would look like the following in your script settings:

    Code:
    Server Host: '[b]localhost[/b]'
    username: '[b]james_[/b]username'
    password: 'password'
    database: '[b]james_[/b]dbname'
    
    Hope that helps!

    PS: Aside from the place in your control panel to setup MySQL databases,
    there is also an interface called 'phpMyAdmin' that you can use to directly
    access and work on the contents of your databases.
     
  8. kbun

    kbun Member

    Joined:
    Sep 4, 2009
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi spiral,

    You are right :D everything work fine after i replace the Example Web Page with local host ...

    Thank you very much for your advice.

    Jim
     
Loading...

Share This Page