MYSQL error

Locked
Results 1 to 14 of 14
This thread is locked. New replies are disabled.
24 Jan 2007, 11:12
#1
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

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: file:///C:/DOCUME%7E1/Rohin/LOCALS%7E1/Temp/msohtml1/01/clip_image001.gif
#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
24 Jan 2007, 12:01
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

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.
26 Jan 2007, 10:28
#3
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

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
26 Jan 2007, 11:34
#4
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

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.
26 Jan 2007, 23:50
#5
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

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');

?>
27 Jan 2007, 00:01
#6
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

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.
27 Jan 2007, 00:05
#7
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: MYSQL error

sportrecovery:

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/ ?
27 Jan 2007, 06:02
#8
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

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.
:down:
27 Jan 2007, 09:13
#9
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Posts:
10,475
Plugin Contributions:
9

Re: MYSQL error

Do you get any warnings before this? They're often where the helpful is.
27 Jan 2007, 14:36
#10
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

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?
27 Jan 2007, 15:33
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: MYSQL error

Sounds like your FTP program didn't upload all your files properly ... namely in the /includes/functions folder. But I wouldn't isolate your review to just that folder, as if one folder has had problems, usually others do too.
28 Jan 2007, 04:52
#12
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

Re: MYSQL error

:D:D:D:D:D
Thanks so much for all your help. It finally all got solved.
You lot are sensational!
28 Jan 2007, 06:19
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: MYSQL error

Did you just need to reload the files? Or was there another solution that finally worked for you? :smile:
28 Jan 2007, 10:06
#14
sportrecovery avatar

sportrecovery

New Zenner

Join Date:
Jan 2007
Posts:
33
Plugin Contributions:
0

Re: MYSQL error

It was a file problem. For some very strange reason (probably a ftp stuff up by me) some files and folders were going root directory of my space and not the www folder. Got that fixed, then got a few config write issues but all is up and running now. Very happy.