Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2007
    Posts
    5
    Plugin Contributions
    0

    Default weird database issue

    I had the basic setup up and running. I could open the cart and admin pages on my server. I can still open the admin pages, but when I go to the main shopping cart area, I get this error:

    Code:
    Sorry!
    There seems to be a problem connecting to our database. Please give us a few minutes to remedy the problem. Thank you.
    
     
    
    
    To verify the site status ... Click here
    As far as I can tell - it's probably a setting in the tables somewhere, but I don't know where:
    (1) I can log into the database directly using configure.php information in the main cart area, and perform inserts/selects/deletes/describes/show-tables. The database settings seem to be correct
    (1.1) The mysql.db, mysql.table_privs, mysql.column_privs support this as being expected
    (2) It doesn't appear to be a PHP<->SQL communication problem - the Administrative page, including loging in, works fine, only the main cart page is broken.
    (3) Since then, on the main system, the kernel has not been recompiled, nor has world. I did do the requisite recompilse for Xorg6.9->7.2, but that shouldn't affect the jailed environment, since it has it's own executables for everthing but the kernel (including it's own world executables, now that I think about it)

    Any suggestions on where to go next in my testing/debugging?

    Thanks,
    -Jim Stapleton


    What I have done so far.

    I tried logging into the database with the account in my /www/cart/includes/configure.php - my database is mysql, same as the DB_TYPE, all the tables in the database start with the same string as DB_PREFIX (woodcraft), the server is localhost, as with DB_SERVER, DB_SERVER_USERNAME is zen, the pasword was copied and pasted straight from the file into the login request, the database name is zencart (I did a use zencart immediately after logging in), USE_PCONNECT is false, STORE_SESSIONS is 'db'.

    once in, tried adding and removing an entry from woodcraftzones (using a zoneid well above any existing to not cause problems), it worked just fine. No errors to the insert, the data appeared in the table, no error on the delete, the data dissapeared from the table.

    the mysql.db table looks like this:
    Code:
    mysql> select * from db where user='zen' and host='localhost';
    +-----------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+
    | Host      | Db      | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv |
    +-----------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+
    | localhost | zencart | zen  | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                | N                | N              | N                   | N                  | N            |
    +-----------+---------+------+-------------+-------------+-------------+-------------+-------------+-----------+------------+-----------------+------------+------------+-----------------------+------------------+------------------+----------------+---------------------+--------------------+--------------+
    1 row in set (0.02 sec)
    tables_priv and columns_priv are empty.


    info:
    [root@legolas /www/cart/includes]# php --version
    PHP 4.4.6 with Suhosin-Patch 0.9.6 (cli) (built: Mar 28 2007 09:32:08)
    Copyright (c) 1997-2007 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

    [root@legolas /www/cart/includes]# mysql --version
    mysql Ver 14.7 Distrib 4.1.22, for portbld-freebsd6.2 (i386) using 5.0

    [root@legolas /www/cart/includes]# uname -a
    FreeBSD legolas.ameritech.net 6.2-STABLE FreeBSD 6.2-STABLE #0: Sun Apr 8 14:50:03 UTC 2007 [email protected]:/usr/obj/usr/src/sys/JIM20070408-SMP i386

    It is running in a jail environment that can only be accessed from the local network.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: weird database issue

    Your store will be redirected to that page when the mysql_connect() or mysql_select_db() call fails.

    This can happen if the DB_xxxxxx information in your configure.php file is incorrect, or if the file itself is corrupt on the server, or if the MySQL Connector for PHP installed on your server is not supported by the MySQL engine version running on the server.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: weird database issue

    Which file is corrupt?

    The information should be correct since I can connect using it and the command line.
    The MySQL connector should be fine, since the admin pages connect fine..

    Quote Originally Posted by DrByte View Post
    Your store will be redirected to that page when the mysql_connect() or mysql_select_db() call fails.

    This can happen if the DB_xxxxxx information in your configure.php file is incorrect, or if the file itself is corrupt on the server, or if the MySQL Connector for PHP installed on your server is not supported by the MySQL engine version running on the server.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: weird database issue

    Yes, I agree ... if the admin pages load fine, then the core system files are probably fine.

    But even if your /admin/includes/configure.php settings are okay, that doesn't mean that your storefront's settings in /includes/configure.php are correct.

    There are intentionally two separate, somewhat similar, somewhat different configure.php files, as indicated. Make sure your storefront file is correct.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: weird database issue

    I used the storefront's configuration file, not the admin file, to do the test login to the database.

    Which file does the database connection and selection occur in?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: weird database issue

    Quote Originally Posted by sjss View Post
    I used the storefront's configuration file, not the admin file, to do the test login to the database.
    Did you do this by copying from the file located on the server or one on your PC?
    Often folks edit the file on the PC and mistakenly believe that the upload via FTP was successful, but it failed because the file was marked read-only on the server. Thus, thinking that the data on the PC is the same as the server, they're convinced that there's a system problem, when it's really a file content mismatch problem.

    Which file does the database connection and selection occur in?
    includes/classes/db/mysql/query_factory.php
    NOTE: This same file is used by both the admin and storefront. ... So, the problem is still likely related to a problem in your storefront configure.php file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: weird database issue

    Quote Originally Posted by DrByte View Post
    Did you do this by copying from the file located on the server or one on your PC?
    Often folks edit the file on the PC and mistakenly believe that the upload via FTP was successful, but it failed because the file was marked read-only on the server. Thus, thinking that the data on the PC is the same as the server, they're convinced that there's a system problem, when it's really a file content mismatch problem.
    This is the test server and my pc. It's the same file.
    /www/cart/includes/configure.php [inside jail]
    /jail/www/cart/includes/configure.php [outside jail]

    there is no /www directory outside the jail, so there could be no confusion there.



    Quote Originally Posted by DrByte View Post
    includes/classes/db/mysql/query_factory.php
    NOTE: This same file is used by both the admin and storefront. ... So, the problem is still likely related to a problem in your storefront configure.php file.
    thanks/that's fine, I plan on dropping a couple of debugging "echo"s in there, to see what I can find.

  8. #8
    Join Date
    Jun 2007
    Posts
    5
    Plugin Contributions
    0

    Default Re: weird database issue

    Just an update. It is fixed now. It was some weird MySQL errors I cant explain, other than I had to reboot. I think it was originally one set, that ended up migrating to another set when I tried to resolve them. The final set was there was a defunct MySQL process that didn't show up on PS -A, taking up the port, so I couldn't start another. I rebooted the machine and it was all fine.

 

 

Similar Threads

  1. Weird Shipping Issue
    By CosmosK in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 12 Mar 2015, 03:08 AM
  2. Attributes Issue---Weird
    By timhersh in forum Customization from the Admin
    Replies: 9
    Last Post: 4 Nov 2011, 02:12 PM
  3. Weird Title Issue...
    By jill8026 in forum General Questions
    Replies: 1
    Last Post: 26 Aug 2009, 01:23 PM
  4. Weird Text Issue
    By jill8026 in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 12 May 2008, 05:58 PM

Posting Permissions

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