0

when copying a table from database to database with phpMyAdmin, I get an error for Timestamp row.

This is my SQL statement:

CREATE  TABLE  `database`.`table` (  `id` int( 10  )  
    unsigned NOT  NULL  AUTO_INCREMENT ,
`Timestamp` timestamp( 6  )  NOT  NULL DEFAULTCURRENT_TIMESTAMP( 6  )  
    ON  UPDATE CURRENT_TIMESTAMP( 6  ) ,
`row3` tinyint( 1  )  DEFAULT NULL  COMMENT  'Comment',
`row4` tinyint( 1  )  DEFAULT NULL  COMMENT  'comment',
PRIMARY  KEY (  `id`  ) ,
KEY  `keyname` (  `row4`  )  ) ENGINE  =  MyISAM  
    DEFAULT CHARSET  = latin1 COLLATE  = latin1_german2_ci

And this is the error message:

#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 'DEFAULTCURRENT_TIMESTAMP( 6  )  ON  UPDATE CURRENT_TIMESTAMP( 6  ) 
at line 2  

I think that there is something wrong with DEFAULTCURRENT_TIMESTAMP and Timestamp (6), but I don't know, what.

Peter
  • 1,224
  • 3
  • 16
  • 28

1 Answers1

0

The version of phpMyAdmin that you're using is extremely old. Currently, version 4.7 is out; your version 2.11.11.3 is over seven years old. Probably this is some bug that has been fixed, but could also be an incompatibility with your PHP, MySQL, and phpMyAdmin versions (depending on what those other versions are). There are some bug reports from around that time that might be related, but it's difficult for me to trace back and test against such old versions. I suggest that you upgrade to the latest version that you're able to (based on the version requirements) and see if the problem continues.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • The issue is still present in version 4.4.15. At least it is for me. The problem is, that phpMyAdmin fails to add a " " character between `DEFAULT` and `CURRENT_TIMESTAMP`. If anyone knows a solution to this, I would be grateful. – Adam Baranyai May 23 '19 at 09:26
  • 1
    Indeed this is broken on 4.4.15, but that version is three and a half years old. Version 4.8.5 (the current version) doesn't have this problem, and while I don't remember writing this message a year ago, presumably 4.7 didn't have it either. Unfortunately, the phpMyAdmin project isn't fixing bugs such as this in such old versions, so the best advice I can offer is to make sure you have the required PHP and MySQL/MariaDB versions and upgrade to a more recent (and supported) phpMyAdmin version. – Isaac Bennetch May 24 '19 at 19:43