Bear with me, I will waffle on for my first post - hello everybody :P
Have just been thru this nightmare - I suggest you DO NOT use cpanel to backup an SQL database - as it often does not restore when you want it to, and it also adds strange code to the backup file. You must use phpMyAdmin as suggested above.
For example you will find it adds \ to all your hyperlinks - i.e. img src="
www.mysite.com/image.jpg" becomes img src=
\"www.mysite.com/image.jpg\"
This can often be fixed by a find/replace in notepad of find: \" and replace: "
Also any single quote ' will also be altered to read \' - this is harder to replace, I just went thru and replaced it with nothing - in other words deleted it, so now some of my content now shows as youll instead of you'll
Also, because the cpanel backup function does not use the back quote ` (note this is the key next to number 1 on keyboard) - try restore the fixed database using phpMyAdmin, and everytime you get a 1064 error in syntax - you must manually fix it. I know from past experience that it does not like terms like "fulltext", "introtext" and "option"
When you get this 1064 error, read where it states the error occurs, then fix it by adding a ` backquote before and after the word.
This is very confusing, so I have placed examples below:
1064 error because of MySQL conflict (MySQL uses this word and so does not realise it should be a table)
DROP TABLE IF EXISTS mos_components;
CREATE TABLE mos_components (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL default '',
link varchar(255) NOT NULL default '',
menuid int(11) unsigned NOT NULL default '0',
parent int(11) unsigned NOT NULL default '0',
admin_menu_link varchar(255) NOT NULL default '',
admin_menu_alt varchar(255) NOT NULL default '',
option varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0',
admin_menu_img varchar(255) NOT NULL default '',
iscore tinyint(4) NOT NULL default '0',
params text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
must be made into
DROP TABLE IF EXISTS mos_components;
CREATE TABLE mos_components (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL default '',
link varchar(255) NOT NULL default '',
menuid int(11) unsigned NOT NULL default '0',
parent int(11) unsigned NOT NULL default '0',
admin_menu_link varchar(255) NOT NULL default '',
admin_menu_alt varchar(255) NOT NULL default '',
`option` varchar(50) NOT NULL default '',
ordering int(11) NOT NULL default '0',
admin_menu_img varchar(255) NOT NULL default '',
iscore tinyint(4) NOT NULL default '0',
params text NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
as well as the insert table bit below which may contain
INSERT INTO mos_components (id, name, link, menuid, parent, admin_menu_link, admin_menu_alt,
option, ordering, admin_menu_img, iscore, params) VALUES (1,'Banners','',0,0,'','Banner Management','com_banners',0,'js/ThemeOffice/component.png',0,'');
so change into
INSERT INTO mos_components (id, name, link, menuid, parent, admin_menu_link, admin_menu_alt,
`option`, ordering, admin_menu_img, iscore, params) VALUES (1,'Banners','',0,0,'','Banner Management','com_banners',0,'js/ThemeOffice/component.png',0,'');
For hyperlinks change this:
into this
and for single quotes change this:
isn\'t
into this:
isnt
Maybe you could try to use a ` backquote around the ' like isn`'`t but I wasnt prepared to try as I had one humongous database to fix and this was the least of my worries.
Once I had found all the \", \' and words that MySQL doesnt like in tables like 'option', then I could use phpMyAdmin to restore fixed database.
Thats my story...........