Thread: MYSQL error

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jan 2007
    Posts
    33
    Plugin Contributions
    0

    Default MYSQL error

    I have had to move my server recently and am getting the below error when I try to upload my database back up. Ive followed all the steps to the letter and searched for an answer to this question but just cant seem to solve it. Any help will be very apreciated.

    REATE TABLE `zen_address_book` (
    `address_book_id` int( 11 ) NOT NULL AUTO_INCREMENT ,
    `customers_id` int( 11 ) NOT NULL default '0',
    `entry_gender` char( 1 ) NOT NULL default '',
    `entry_company` varchar( 32 ) default NULL ,
    `entry_firstname` varchar( 32 ) NOT NULL default '',
    `entry_lastname` varchar( 32 ) NOT NULL default '',
    `entry_street_address` varchar( 64 ) NOT NULL default '',
    `entry_suburb` varchar( 32 ) default NULL ,
    `entry_postcode` varchar( 10 ) NOT NULL default '',
    `entry_city` varchar( 32 ) NOT NULL default '',
    `entry_state` varchar( 32 ) default NULL ,
    `entry_country_id` int( 11 ) NOT NULL default '0',
    `entry_zone_id` int( 11 ) NOT NULL default '0',
    PRIMARY KEY ( `address_book_id` ) ,
    KEY `idx_address_book_customers_id_zen` ( `customers_id` )
    ) ENGINE = MYISAM DEFAULT CHARSET = latin1 AUTO_INCREMENT =20;
    MySQL said: [IMG]file:///C:/DOCUME%7E1/Rohin/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif[/IMG]
    #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=20' at line 17

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: MYSQL error

    This is probably because the version of MySQL on each of the servers is different. I recommend making a copy of your backup, then editing the copy to remove all references to
    ENGINE = MYISAM DEFAULT CHARSET = latin1
    (leave references to autincrement in place).

    Then put your original backup somewhere safe, then try importing the edited copy. Hopefully that will load, but test thoroughly. Good luck.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: MYSQL error

    Thanks for this, This worked fine. I then ran the fix_cache.php file but I got the below error.
    Ive looked through the files its listing but nothing is coming up that I can seem to fix.
    Another thing, when I now try to go to my shop I get this in my browser
    "Not Found

    The requested URL /shop/zc_install/index.php was not found on this server.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request."



    I installed Zen_cart through fantastico on my server. Ill try to find the install direcotory somewhere and uplad that. will that work? Soon find out.


    This is my error with the fix cache

    Warning: Cannot modify header information - headers already sent by (output started at /home/sportrec/public_html/shop/fix_cache_key.php:43) in /home/sportrec/public_html/shop/includes/application_top.php on line 60

    Warning: main(/home/recovery/public_html/shop/includes/classes/class.base.php) [function.main]: failed to open stream: No such file or directory in /home/sportrec/public_html/shop/includes/autoload_func.php on line 59

    Warning: main() [function.include]: Failed opening '/home/recovery/public_html/shop/includes/classes/class.base.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sportrec/public_html/shop/includes/autoload_func.php on line 59

    Warning: main(/home/recovery/public_html/shop/includes/classes/class.notifier.php) [function.main]: failed to open stream: No such file or directory in /home/sportrec/public_html/shop/includes/autoload_func.php on line 59

    Warning: main() [function.include]: Failed opening '/home/recovery/public_html/shop/includes/classes/class.notifier.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/sportrec/public_html/shop/includes/autoload_func.php on line 59

    Fatal error: Cannot instantiate non-existent class: notifier in /home/sportrec/public_html/shop/includes/autoload_func.php on line 78

    Thanks for you help on this. apreciate it

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: MYSQL error

    The absence of the install directory is a clue rather than something to be fixed. It's normal for security purposes for it to be absent in a fully-functioning store. The question here is why isn't yours fully-functioning and therefore looking for the installation directory.

    The normal reasons are because the configure.php files are missing, or if they are there, they are pointing to the wrong locations. You say you have moved servers recently, did you reinstall from scratch using Fantastico (I'm not a big fan of this script) or did you move the code from a previous Fantastico installation (perfectly legitimate move, I do it all the time), and if so, did you update the configure.php files to reflect the site's new location?

    The headers already sent warnings leading to a fatal error are because some output is being sent to your browser prematurely from the fix_cache_key.php file. Sometimes this is as simple as a non-visible space appearing after the final ?> tag in which case it can simply be deleted. However, I have never used that script so have no direct experience of the problem that you describe.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Jan 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: MYSQL error

    Slightly lenghthy process. The database wasnt uploading when I created one so I did a fantastico install. I then deleted all the files on the server and upladed my original shop files. Then I dropped all the tables on the _zc2 database and thanks to the support forum fixed the import problem and thats where im at now.

    The only other thing I did was manage to not check the config files for the password to the _zc2 database so ive created a new database user and password and put its infor to the two config files.
    Any help very apreciated.

    Here is my admin/includes/config
    <?php
    //
    /**
    *
    * @package Configuration Settings
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    */


    // Define the webserver and path parameters
    // Main webserver: eg, http://localhost - should not be empty for productive servers
    // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
    // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
    // HTTP_CATALOG_SERVER is your Main webserver: eg, http://www.yourdomain.com
    // HTTPS_CATALOG_SERVER is your Secure webserver: eg, https://www.yourdomain.com
    /*
    * URLs for your site will be built via:
    * HTTP_SERVER plus DIR_WS_ADMIN or
    * HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or
    * HTTP_SERVER plus DIR_WS_CATALOG or
    * HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG
    * ...depending on your system configuration settings
    */
    define('HTTP_SERVER', 'http://sportrecovery.com.au');
    define('HTTPS_SERVER', 'https://sportrecovery.com.au');
    define('HTTP_CATALOG_SERVER', 'http://sportrecovery.com.au');
    define('HTTPS_CATALOG_SERVER', 'https://sportrecovery.com.au');

    // Use secure webserver for catalog module and/or admin areas?
    define('ENABLE_SSL_CATALOG', 'false');
    define('ENABLE_SSL_ADMIN', 'false');

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
    // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
    define('DIR_WS_ADMIN', '/shop/admin/');
    define('DIR_WS_CATALOG', '/shop/');
    define('DIR_WS_HTTPS_ADMIN', '/shop/admin/');
    define('DIR_WS_HTTPS_CATALOG', '/shop/');

    define('DIR_WS_IMAGES', 'images/');
    define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
    define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
    define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
    define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

    // * DIR_FS_* = Filesystem directories (local/physical)
    //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
    define('DIR_FS_ADMIN', '/home/recovery/public_html/shop/admin/');
    define('DIR_FS_CATALOG', '/home/recovery/public_html/shop/');

    define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
    define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
    define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
    define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
    define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
    define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

    // define our database connection
    define('DB_TYPE', 'mysql');
    define('DB_PREFIX', 'zen_');
    define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty
    define('DB_SERVER_USERNAME', 'sportrec_shop');
    define('DB_SERVER_PASSWORD', 'MYPASSWORD');
    define('DB_DATABASE', 'sportrec_zc2');
    define('USE_PCONNECT', 'false'); // use persistent connections?
    define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'

    // The next 2 "defines" are for SQL cache support.
    // For SQL_CACHE_METHOD, you can select from: none, database, or file
    // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
    // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
    // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
    define('SQL_CACHE_METHOD', 'database');
    define('DIR_FS_SQL_CACHE', '/home/recovery/public_html/shop/cache');

    ?>

    And my /includes/config



    <?php
    /**
    *
    * @package Configuration Settings
    * @copyright Copyright 2003-2006 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    */


    // Define the webserver and path parameters
    // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
    // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
    define('HTTP_SERVER', 'http://sportrecovery.com.au');
    define('HTTPS_SERVER', 'https://sportrecovery.com.au');

    // Use secure webserver for checkout procedure?
    define('ENABLE_SSL', 'false');

    // NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
    // * DIR_WS_* = Webserver directories (virtual/URL)
    // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
    define('DIR_WS_CATALOG', '/shop/');
    define('DIR_WS_HTTPS_CATALOG', '/shop/');

    define('DIR_WS_IMAGES', 'images/');
    define('DIR_WS_INCLUDES', 'includes/');
    define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
    define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
    define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
    define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
    define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
    define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

    define('DIR_WS_PHPBB', '/');

    // * DIR_FS_* = Filesystem directories (local/physical)
    //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
    define('DIR_FS_CATALOG', '/home/recovery/public_html/shop/');

    define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
    define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
    define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
    define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
    define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

    // define our database connection
    define('DB_TYPE', 'mysql');
    define('DB_PREFIX', 'zen_');
    define('DB_SERVER', 'localhost'); // eg, localhost - should not be empty
    define('DB_SERVER_USERNAME', 'sportrec_shop');
    define('DB_SERVER_PASSWORD', 'MYPASSWORD');
    define('DB_DATABASE', 'sportrec_zc2');
    define('USE_PCONNECT', 'false'); // use persistent connections?
    define('STORE_SESSIONS', 'db'); // leave empty '' for default handler or set to 'db'

    // The next 2 "defines" are for SQL cache support.
    // For SQL_CACHE_METHOD, you can select from: none, database, or file
    // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache
    // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
    // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash
    define('SQL_CACHE_METHOD', 'database');
    define('DIR_FS_SQL_CACHE', '/home/recovery/public_html/shop/cache');

    ?>

  6. #6
    Join Date
    Jan 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: MYSQL error

    I just found that I had failed to change the home/recover/ to home/sportrecovery/ I have done this but getting the same error.

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: MYSQL error

    Quote Originally Posted by sportrecovery View Post
    I just found that I had failed to change the home/recover/ to home/sportrecovery/ I have done this but getting the same error.
    Should that be home/sportrec/ ?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Jan 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: MYSQL error

    Thanks for the pic up.
    Im now getting this

    Fatal error
    : Call to undefined function: zen_session_save_path() in /home/sportrec/public_html/shop/includes/languages/english.php on line 308

    Got me stumped again.


  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: MYSQL error

    Do you get any warnings before this? They're often where the helpful is.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Jan 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: MYSQL error

    No. I get only this come up. It happens when I run fixcache as well.
    I can still get access to my original server and database if this can help?

    I am willing to install a whole new shop and add products again if you think I can upload my customers to a new shops database?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Fatal error: mysql error (1064 error) -- v1.0-alpha
    By Dale Schibbelhut in forum General Questions
    Replies: 9
    Last Post: 18 Nov 2010, 08:08 PM
  2. MySQL Error 1064 You have an error in your SQL syntax;
    By dmm2020 in forum General Questions
    Replies: 2
    Last Post: 22 Feb 2009, 05:02 AM
  3. Dreaded mYSQL 1064 error when importing MySQL 4 database into MySQL5
    By dml311071 in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 10 Jun 2008, 05:38 AM
  4. mysql error
    By bidsea in forum General Questions
    Replies: 2
    Last Post: 17 Oct 2006, 04:32 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