Ghost database? Help, please

Discussion in 'Site & Server Administration' started by fryman, Mar 28, 2005.

  1. #1
    I just got hold of a new site. It is a game cheats site, so I guess it uses some kind of database to pull out the cheats.

    The site uses a file where the database information is, and it says:

    <?php
    $dbhost = "localhost";
    $dbuser = "cheatwir_usr1";
    $dbpass = "swiqer55";
    $db = "cheatwir_db";
    $conn = mysql_connect($dbhost, $dbuser, $dbpass);
    mysql_select_db($db, $conn);
    ?>

    But I logged in the cpanel, took a look at the databases section, and there is no cheatwir database! Neither is there a cheatwir user, however, the site is working fine. Any idea of how can this be happening?
    :confused:
     
    fryman, Mar 28, 2005 IP
  2. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #2
    Is this information from the local copy or off the server?
     
    ResaleBroker, Mar 28, 2005 IP
  3. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #3
    The owner of the site gave me access to his server. I did a complete backup of the site and moved it to my server. When I tried to see it, I got all kind of msql errors. I then noticed the reference to that database. I checked the owners pages ( which are working fine), and they have the same reference, and I can0t find that database on the owner's server.
     
    fryman, Mar 28, 2005 IP
  4. mkeen

    mkeen Peon

    Messages:
    186
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Upload a page with this in it, call it say test.php

    <?php
    system("mysql_dump -u cheatwir_usr1 cheatwir_db -p swiqer55 >> dump.sql");
    echo "done";
    ?>

    Hit up test.php in your browser and then download the dump file once it says done.
     
    mkeen, Mar 28, 2005 IP
  5. afactory

    afactory Well-Known Member

    Messages:
    336
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #5
    You can try to find this database via SSH and MySQL directly. Maybe cpanel shows not all databases?
     
    afactory, Mar 28, 2005 IP
  6. jrm

    jrm Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I would go with what mkeen said. I have migrated sites this way. It is easy to insert all of the records too! All you need to do is Create the cheatwir_db database, then in a command prompt (telnet session or what ever) type : mysql -u username -p -h hostname-or-IP cheatwir_db < dump.sql

    JRM
     
    jrm, Mar 29, 2005 IP
  7. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #7
    Turns out he had the database on another account.

    Sloppy as can be... I am having a terrible time cleaning up the mess
     
    fryman, Mar 29, 2005 IP
  8. jrm

    jrm Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    It's not to strange. I do that too. One site doesn't have much space so the database is on a different server and user. Yeah I guess it probably is a mess, but I work with what I am given.

    JRM
     
    jrm, Mar 29, 2005 IP
  9. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #9
    I was pulling my hair out trying to find the damn database, only to finally find out that it was on another server
     
    fryman, Mar 29, 2005 IP
  10. jrm

    jrm Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    If you use the commands previously shown you don't need to know where the database is, just dump it and put it where you want it to be.

    JRM
     
    jrm, Mar 29, 2005 IP
  11. danpadams

    danpadams Peon

    Messages:
    101
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Along the idea of having a database on a different account, if it is the same person working with the database it can be easier to have them under the same account for the ideas of an editor and switching between the database, that way they don't have to use a different username for each database.
     
    danpadams, Mar 29, 2005 IP
  12. john_loch

    john_loch Rodent Slayer

    Messages:
    1,294
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    138
    #12
    I tend to do this too, especially if I have a group of sites using the same back end, and I'm working with cpanel or the like.

    It's damned annoying to troubleshoot I know. Been there myself. But sometimes it's the quickest alternative. You'll notice the benefits if you're pulling a lot of content from third parties for distribution across a number of sites.. :)

    Cheers,

    JL
     
    john_loch, Mar 29, 2005 IP
  13. Juls

    Juls Well-Known Member

    Messages:
    1,867
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    170
    #13
    hate to admit it but i do it too. i would think admins that host multiple sites on the same server probably do it too. it is just a convenience thing. bad habit to pick up.
     
    Juls, Mar 29, 2005 IP