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.

Were Do I Find my dattabase Info??

Discussion in 'Database Discussions' started by walkingjukebox, Jan 20, 2009.

  1. walkingjukebox

    walkingjukebox Registered

    Joined:
    Jan 20, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    HI!
    Im pretty new to all this but am slowly learning.
    This is prob. a no brainer question but where would i find this information
    to fill this out???:confused:


    $cfg['db']['hostname'] = "localhost";
    $cfg['db']['dbname'] = "database_name";
    $cfg['db']['username'] = "database_user";
    $cfg['db']['password'] = "database_pass";

    Thank you so much in advace!!
     
  2. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    You will need to first create the database and the database user from the cPanel. Once you create them, you can specify database and database user in your config files.
     
  3. walkingjukebox

    walkingjukebox Registered

    Joined:
    Jan 20, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    so ive created a new database in cpanel called stats.
    Then added a user to the stats database with all priviliges.

    and I come up with this...... Whats next?

    Users in stats
    c736382_forum (Privileges: ALL PRIVILEGES)

    Connection Strings

    Perl $dbh = DBI->connect("DBI:mysql:c736382_stats:localhost",
    "c736382_forum","<PASSWORD HERE>");

    PHP $dbh=mysql_connect ("localhost", "c736382_forum",
    "<PASSWORD HERE>") or die('Cannot connect to the database because: ' . mysql_error());
    mysql_select_db ("c736382_stats");
     
  4. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    So here is the info you need:

    $cfg['db']['hostname'] = "localhost";
    $cfg['db']['dbname'] = "c736382_stats";
    $cfg['db']['username'] = "c736382_forum";
    $cfg['db']['password'] = "<PASSWORD HERE>";

    You need to specify the password that you mentioned while creating the database user.
     
  5. walkingjukebox

    walkingjukebox Registered

    Joined:
    Jan 20, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for your attention I appreciate it A ton!
    Ill give this a try and let you know how it turns out :)
     
Loading...

Share This Page