[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: Re: problemas al ejecutar una query en mysql



Walter O. Dari wrote:
> Dajul Goa wrote:
>> Luis A. R. Paz wrote:
>>> bueno creo que el problema anterior lo tengo resuelto gracias antemano
>>> ahora me sucede lo siguiente
>>> estoy creando las tablas para conectar a la base de datos donde se
>>> supone que pondrá los post de los usuarios
>>> pero el servidor me da el siguiente error
>>>
>>>
>>> *SQL query:*
>>>
>>> CREATE TABLE `pastebin` (
>>> `pid` INT( 11 ) NOT NULL ,
>>> `poster` VARCHAR( 16 ) NULL ,
>>> `posted` DATETIME NULL ,
>>> `code` TEXT NOT NULL ,
>>> `parent_pid` INT( 11 ) NOT NULL ,
>>> `format` VARCHAR( 16 ) NULL ,
>>> `codefmt` MEDIUMTEXT NOT NULL ,
>>> `codecss` TEXT NOT NULL ,
>>> `domain` VARCHAR( 225 ) NOT NULL ,
>>> `expires` DATETIME NOT NULL ,
>>> `expiry_flag` ENUM NOT NULL
>>> ) ENGINE = MYISAM
>>>
>>> *MySQL said: *Documentation
>>> <http://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html>
>>>
>>> | #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 'NOT NULL) ENGINE = myisam' at line 1
>>>
>>>
>>> algna idea que pueda estar escribiendo mal ??
>>>
>>> |
>>
>> Este problema también lo tuve yo. Está mal la parte de la KEY, debería
>> ser así (hay que añadir unos paréntesis):
> 
> mmmm... tan distraído estaré ???
> ¿en qué parte de la sintaxis ves que se esté creando un índice?
> 
> Para mi está mal usado ENUM, debería tener especificados los valores
> permitidos.
> 
>> PRIMARY KEY (`pid`),
>> KEY `domain` (`domain`),
>> KEY (`parent_pid`),
>> KEY (`expires`)
>> );
> 
> Saludos,
>      .-----.           Walter
>     / \ _ / \   __
>  (\/  /  \   |_/ºº)    http://www.swcomputacion.com/
>   \--------------~     Usuario Linux 425808
>   // ||   || \\        http://counter.li.org/
> 
> 

Viendo el archivo INSTALL de pastebin. Entiendo que lo habrá leído y
sabrá de que le hablo.

INSTALL:
If using the "mysql" storage engine, setup a new database with the
following
table

CREATE TABLE `pastebin` (
	  `pid` int(11) NOT NULL auto_increment,
	  `poster` varchar(16) default NULL,
	  `posted` datetime default NULL,
	  `code` text,
	  `parent_pid` int(11) default '0',
	  `format` varchar(16) default NULL,
	  `codefmt` mediumtext,
	  `codecss` text,
	  `domain` varchar(255) default '',
	  `expires` DATETIME,
	  `expiry_flag` ENUM('d','m', 'f') NOT NULL DEFAULT 'm',
	
	  PRIMARY KEY  (`pid`),
	  KEY `domain` (`domain`),
	  KEY `parent_pid`,
	  KEY `expires`
	);

-- 
GnuPG 0x8A534CC1

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: