Members: 16,996
Threads: 38,866
Posts: 159,475
Online: 48

Newest Member: Kl_broka@rediffmail.com


Odoo.tv - Outdoor Television


Sedo - Domains kaufen und verkaufen das Projekt mambers.com steht zum Verkauf Besucherstatistiken von mambers.com etracker® Web-Controlling statt Logfile-Analyse
Old 24.10.2004, 15:04   #1 (permalink)
Baby Mamber
 
Join Date: Aug 2004
Posts: 21
JayBlackwood is on a distinguished road
Default SQL Backups fails

A few questions about backups and a comment....

I attempted to restore a backup of the mambo database and it failed. The mos_components table has a field in it named 'option' and this is also a keyword in mySQL (or acts like one) and you get a syntax error when you attempt to restore the db. I changed 'option' to 'zoption' in the SQL, ran the SQL in myPhpAdmin, and then rename the 'zoption' back to 'option'. This worked thankfully.

Here's an example of a SQL line that fails:
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;
FYI - The backup was generated using the backup available in CPanel. Clearly it needed to escape the field name 'option'.

Question #1) - Is there a way in the SQL syntax to get it to understand it is a field name and not a keyword?

Comment #1) - Isn't this an example why it wasn't necessarily a good idea to get rid of the native backup? I actually agree with the long term decision to do this but for now?
JayBlackwood is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 24.10.2004, 15:34   #2 (permalink)
Junior Mamber
 
Join Date: Jul 2004
Posts: 28
Ektoras is on a distinguished road
Default Re: SQL Backups fails

Quote:
Question #1) - Is there a way in the SQL syntax to get it to understand it is a field name and not a keyword?
Yes. You can escape reserved words using backquotes. More details here.
Importing SQL file into MSAS
Ektoras is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 26.10.2004, 20:14   #3 (permalink)
Baby Mamber
 
Join Date: Aug 2004
Posts: 21
JayBlackwood is on a distinguished road
Default Re: SQL Backups fails

Thanks. I obviously didn't search this forum enought before asking the question!
JayBlackwood is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can anyone suggest a SQL script to convert 4.5.0 newsflash to 4.5.1? ppofandt Mambo 4.5.1 Installation and Upgrades 1 12.01.2005 02:39
Updating SQL DB with 4.5.1a ? heyjoe Mambo 4.5.1 Installation and Upgrades 3 18.10.2004 13:04
451 b4 localhost clean inst. SQL error.help? twerp Mambo 4.5.1 Installation and Upgrades 2 19.08.2004 04:33
setting frontpage items to 10 ends in sql error doggystyle Mambo 4.5 General Talk 0 22.05.2004 14:02


All times are GMT +2. The time now is 15:19.

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0
A vBSkinworks Design
© Copyright 2004-2008 by Arthur Konze Webdesign.