Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: can't read from database

  1. #1
    Join Date
    Jan 2005
    Posts
    21

    Exclamation can't read from database

    This is my second installation of OR; the first was a breeze, but this one is giving me problems.

    I have double checked my db connections and used a test script to verify them--they're fine.

    register_globals is set to ON locally, but OFF as the master value.

    PHP 4.3.10, MySQL 3.23.49.

    When I run the configurator, I get a success message, but it doesn't set up any tables in the DB.

    I set up the tables using the .sql file through phpMyAdmin, but the OR script cannot read from the DB. When I try to view the sample listing via http, it isn't there. I also cannot login as the admin using admin/password. I doubled checked the DB and the data is present for the sample listing and the default admin account. The script simply can't communicate with the DB.

    What are the minimum MySQL user privileges required to run OR? I'm trying to figure out right now how to find out what privileges I currently have...

    thanks!
    JF

  2. #2
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    If you can't read from the db then your db settings are wrong in common.php or you didn't give the user access to the db. Even with minimal privledges to the db, if the settings were correct, it would be able to read from it.

  3. #3
    Join Date
    Nov 2004
    Location
    Texas
    Age
    48
    Posts
    92

    Default email me directly

    Email me directly and I will see if I can help

    Rodney
    intersolution@cableone.net
    - Rodney -
    "Let's Build Something Together"

  4. #4
    Join Date
    Jul 2003
    Location
    California
    Age
    42
    Posts
    4,229

    Default

    Double check with your webhost your database settings and permissions... especially double check the database server information.. i've seen several times where the wrong database server settting will allow the script to use the user and password and even have the configurator appear to run without actually loading the data...

    Mick
    Open-Realty 2 Documentation

    ~The Difference Between an ORDEAL and an ADVENTURE is ATTITUDE~

  5. #5
    Join Date
    Nov 2004
    Location
    Texas
    Age
    48
    Posts
    92

    Default tip

    On some host they start your mysql with your user name like

    user_database

    be sure to check that too
    do you have cpanel access???
    - Rodney -
    "Let's Build Something Together"

  6. #6
    Join Date
    Jan 2005
    Posts
    21

    Default

    Thank you everyone for your responses!

    My problem persists. The webhost has confirmed that my connection info is correct, however the test script I am using indicates that I can't change into the DB; is there anything wrong with this little test script?

    PHP Code:
    <?php

    $connection
    =mysql_connect("localhost""myusername""mypass");

    if (!
    $connection) {
        echo 
    "Error. Could not connect to the MySQL server!";
        exit;
    }

    if (!
    mysql_select_db("mydatabase") ) {
        echo 
    "Could not change into the database!";
        exit();
    }

    ?>
    This script generates the "Could not change into the database!" error.

    The host also confirmed that my user priveleges as as follows:

    Select | Insert | Update | Delete | Create | Drop | Index | Alter | Create temp | Lock

    Can anyone provide a PHP snippet that I can use to confirm this? (Not that I don't trust it, but I'd like to have my own way of checking this in the future.)

    I do not have shell access or a Cpanel (not my choice of host, a client's).

    Could the register_globals master value be the issue?

    Thanks!
    JF

  7. #7
    Join Date
    Jan 2005
    Posts
    349

    Default

    try a really simple script:

    <?php

    mysql_connect("$dbhost", "$dbuname", "$dbpass");
    mysql_select_db("$dbname");
    echo mysql_error();

    ?>

    Play with the variables to see what causes a failure

    Here is an elaborate connection tester:
    http://nukecops.com/downloads-file-1...-Analyzer.html

  8. #8
    Join Date
    Jan 2005
    Posts
    21

    Default

    Thanks for your quick reply. The database test script you supplied worked like a charm. The connection details work perfectly. I have these same settings in my common.php file, but the script just doesn't seem to connect to the DB: the configurator sets up nothing, the test listing doesn't display, and the login doesn't work. I don't think my problem is the database connection. What else could this be?

    Thanks also for the analyzer download. I grabbed it and will check it out for sure.

    JF

  9. #9
    Join Date
    Jan 2005
    Posts
    349

    Default

    if you have actually added nothing get the size of the or folder on your server.

    Should be around 2175KB

    if the db is connecting I would try a new upload first

  10. #10
    Join Date
    Aug 2004
    Location
    United States of America
    Posts
    668

    Default

    Do you have access to PhpMyAdmin? You can have a database, just as valid as the next and not be able to access it. What your describing seems to me to be a restricted account. You can create a database and may even be able to add tables, but not communicate with it beyond a connection.

    <<<<<side note>>>>>>>>
    If its a new install. Start over.
    <<<<<<<<>>>>>>>>>>>>

    Jared.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •