mysql syntax error ?

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications mysql syntax error ?
# 1  
Old 07-24-2009
mysql syntax error ?

hi,

I receive this error when I export/import a table from a database to another one:

Code:
Error
SQL query:

--
-- Database: `mil`
--
-- --------------------------------------------------------
--
-- Table structure for table `jos_taoj`
--
CREATE TABLE IF NOT EXISTS  `jos_taoj` (

 `id` INT( 10 ) NOT NULL AUTO_INCREMENT ,
 `extension` VARCHAR( 100 ) NOT NULL COMMENT  'The extension',
 `version` VARCHAR( 16 ) NOT NULL COMMENT  'Version number',
 `installed_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT  'Date-time modified or installed',
 `log` MEDIUMTEXT,
PRIMARY KEY (  `id` ) USING BTREE,
KEY  `idx_extension` (  `extension` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 COMMENT =  'The Art of Joomla extension version history' AUTO_INCREMENT =2;

MySQL said: 

#1064 - Erreur de syntaxe près de 'USING BTREE,
  KEY `idx_extension` (`extension`)
) ENGINE=MyISAM' à la ligne 7

could you give me some help ?

thanks
# 2  
Old 07-24-2009
Hi.

Should it not be:

Code:
PRIMARY KEY USING BTREE(  `id` ),

Code:
Your SQL query has been executed successfully (Query took 0.0847 sec)

SQL query:
CREATE TABLE IF NOT EXISTS `jos_taoj` (
`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`extension` VARCHAR( 100 ) NOT NULL COMMENT 'The extension',
`version` VARCHAR( 16 ) NOT NULL COMMENT 'Version number',
`installed_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'Date-time modified or installed',
`log` MEDIUMTEXT,
PRIMARY KEY USING BTREE(
`id` 
),
KEY `idx_extension` ( `extension` ) 
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =2;

# 3  
Old 07-24-2009
Are you exporting/importing between different MySQL versions?
Take a look at the --compatible option of the mysqldump command.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies

2. Linux

Ambiguous redirect error and syntax error when using on multiple files

Hi, I need help on following linux bash script. When I linux commands for loop or while loop on individual file it runs great. but now I want the script to run on N number of files so it gives me ambiguous redirect error on line 12 and syntax error on line 22 : (pls help ); #!/bin/bash #... (16 Replies)
Discussion started by: Madhusudan Das
16 Replies

3. Shell Programming and Scripting

syntax issue mysql in bash script

I'm running mysql in a bash script mysql <<EOF query EOF one query is like this: UPDATE $dbname.$prefix"config" SET value = $var WHERE "$prefix"config.name = 'table colname'; with variable but it's giving an error i'm not sure what to put for "$prefix"config.name the table... (3 Replies)
Discussion started by: vanessafan99
3 Replies

4. Shell Programming and Scripting

syntax issue with quotes in mysql command for a bash script

i'm trying to write a bash script that executes a mysql statement mysql -sN -e INSERT INTO "$database"."$tableprefix"users (var1, var2,var3) VALUES (123, '1','') i don't know where to put the quotes it doesnt work with this one: ` it seems i can only put double quotes around the... (0 Replies)
Discussion started by: vanessafan99
0 Replies

5. Shell Programming and Scripting

Receiving error: ./ang.ksh[35]: 0403-057 Syntax error at line 116 : `done' is not expected.

Hi All I am quite new to Unix. Following is a shell script that i have written and getting the subject mentioned error. #!/bin/ksh #------------------------------------------------------------------------- # File: ang_stdnld.ksh # # Desc: UNIX shell script to extract Store information.... (3 Replies)
Discussion started by: amitsinha
3 Replies

6. Programming

Newbie Question.. -> error: syntax error before ';' token

Hello, the following is generating a error at the line "tmprintf(&tmBundle, _TMC("{0}"),Prompt);"... a bit lost as I am diving into this debug... Thank you in advance... int H_YesNo(TMCHAR *Prompt, int DefVal) { TMCHAR YesNo = '\0'; tmprintf(&tmBundle, _TMC("{0}"),Prompt); while... (3 Replies)
Discussion started by: reelflytime
3 Replies

7. Shell Programming and Scripting

sed error : Syntax error: redirection unexpected

My script is throwing the error 'Syntax error: redirection unexpected' My line of code.. cat nsstatustest.html | sed s/<tr><td align="left">/<tr><td align="left" bgcolor="#000000"><font color="white">/ > ztmp.Ps23zp2s.2-Fpps3-wmmm0dss3 HTML tags are getting in the way but they're needed to... (3 Replies)
Discussion started by: phpfreak
3 Replies

8. AIX

nim mksysb error :/usr/bin/savevg[33]: 1016,07: syntax error

-------------------------------------------------------------------------------- Hello, help me please. I am trying to create a mksysb bakup using nim. I am geting this error, how to correct it ? : Command : failed stdout: yes stderr: no... (9 Replies)
Discussion started by: astjen
9 Replies

9. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
Login or Register to Ask a Question