This is a discussion on What is wrong with this command ? within the MySQL forums, part of the Database Server Software category; --> I made a mysqldump with version 3. I want to import this into version 4 but I get an ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I made a mysqldump with version 3. I want to import this into version 4 but I get an error. Does anyone know why this doesn't work ? ----- mysql> CREATE TABLE mod_banner ( -> banner_id bigint(20) NOT NULL auto_increment, -> titel varchar(255) NOT NULL default '', -> mod bigint(20) NOT NULL default '0', -> id bigint(20) NOT NULL default '0', -> url varchar(255) NOT NULL default '', -> PRIMARY KEY (banner_id) -> ) TYPE=MyISAM; ERROR 1064 (42000): 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 'mod bigint(20) NOT NULL default '0', id bigint(20) NOT NULL default '0', url' at line 4 Thank you for any help. |
| |||
| R.Smits schreef: > I made a mysqldump with version 3. I want to import this into version 4 but > I get an error. Does anyone know why this doesn't work ? > ----- > mysql> CREATE TABLE mod_banner ( > -> banner_id bigint(20) NOT NULL auto_increment, > -> titel varchar(255) NOT NULL default '', > -> mod bigint(20) NOT NULL default '0', > -> id bigint(20) NOT NULL default '0', > -> url varchar(255) NOT NULL default '', > -> PRIMARY KEY (banner_id) > -> ) TYPE=MyISAM; > ERROR 1064 (42000): 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 'mod bigint(20) NOT NULL default '0', > id bigint(20) NOT NULL default '0', > url' at line 4 Hi, The problem is the column named 'mod'. MOD is also a MySQL operator, so you cannot use it as a column-name. Change it into a valid name and you're all set. HTH. Peter. -- http://www.phpforums.nl |
| ||||
| On Fri, 29 Sep 2006 01:03:23 +0200, Peter van Schie wrote: > R.Smits schreef: >> I made a mysqldump with version 3. I want to import this into version 4 but >> I get an error. Does anyone know why this doesn't work ? >> ----- >> mysql> CREATE TABLE mod_banner ( >> -> banner_id bigint(20) NOT NULL auto_increment, >> -> titel varchar(255) NOT NULL default '', >> -> mod bigint(20) NOT NULL default '0', >> -> id bigint(20) NOT NULL default '0', >> -> url varchar(255) NOT NULL default '', >> -> PRIMARY KEY (banner_id) >> -> ) TYPE=MyISAM; >> ERROR 1064 (42000): 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 'mod bigint(20) NOT NULL default '0', >> id bigint(20) NOT NULL default '0', >> url' at line 4 > > Hi, > > The problem is the column named 'mod'. MOD is also a MySQL operator, so > you cannot use it as a column-name. Change it into a valid name and > you're all set. Additionally, '0' is not a valid bigint default value. It's not valid for int or any other numeric type either. '0' is a character, not a number. -- 45. I will make sure I have a clear understanding of who is responsible for what in my organization. For example, if my general screws up I will not draw my weapon, point it at him, say "And here is the price for failure," then suddenly turn and kill some random underling. --Evil Overlord List |