MySQL // Syntax ?

Statut
N'est pas ouverte pour d'autres réponses.

QwesT

Elite
Bonsoir,

Tout d'abord, sachez que je suis débutant en ce qui concerne les bases MySQL...

Je tente, en vain, de déménager une gallerie photo coppermine d'un FTP à un autre...

J'ai exporté un "mabase.sql" de mon serveur initial via phpmyadmin, j'exècute eznsuite ce fichier "mabase.sql" sur mon nouvel hebergement via phpmyadmin toujours... mais là, erreur... pour ce code:
Code:
# --------------------------------------------------------
#
# Structure de la table 'cpg11d_pictures'
#

CREATE TABLE cpg11d_pictures (
pid int(11) NOT NULL auto_increment,
aid int(11) DEFAULT '0' NOT NULL,
filepath varchar(255) NOT NULL,
filename varchar(255) NOT NULL,
filesize int(11) DEFAULT '0' NOT NULL,
total_filesize int(11) DEFAULT '0' NOT NULL,
pwidth smallint(6) DEFAULT '0' NOT NULL,
pheight smallint(6) DEFAULT '0' NOT NULL,
hits int(10) DEFAULT '0' NOT NULL,
mtime timestamp(14),
ctime int(11) DEFAULT '0' NOT NULL,
owner_id int(11) DEFAULT '0' NOT NULL,
owner_name varchar(40) NOT NULL,
pic_rating int(11) DEFAULT '0' NOT NULL,
votes int(11) DEFAULT '0' NOT NULL,
title varchar(255) NOT NULL,
caption text NOT NULL,
keywords varchar(255) NOT NULL,
approved enum('YES','NO') DEFAULT 'NO' NOT NULL,
user1 varchar(255) NOT NULL,
user2 varchar(255) NOT NULL,
user3 varchar(255) NOT NULL,
user4 varchar(255) NOT NULL,
url_prefix tinyint(4) DEFAULT '0' NOT NULL,
randpos int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (pid),
KEY pic_hits (hits),
KEY pic_rate (pic_rating),
KEY aid_approved (aid, approved),
KEY randpos (randpos),
KEY pic_aid (aid),
KEY search (title, caption, keywords, filename) // CETTE LIGNE SEMBLE POSER PROBLEME
);
Code:
MySQL a répondu:
#1170 - BLOB column 'caption' used in key specification without a key length
et dans le cas ou je retire le 'caption' j'obtiens
Code:
MySQL a répondu:
#1071 - Specified key was too long. Max key length is 500
et si je retire toute la ligne "KEY search (title, caption, keywords, filename)" j'obtiens
Code:
MySQL a répondu:
#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 '' at line 31
Bref, je ne m'en sort pas ... ma version SQL est "Client API version 4.0.24"

Toute remarques est là très bienvenue.. et si vous connaissez un endroit ou je peux trouver un pro.. :)
 

MbK_

Etudjant
et si tu exportes la table en "text" mais pas en .sql


c'est ce que j'ai tjs fait et ca marche nikel
 

ZyPh0s

Touriste
Attention là tu n'as que la structure de la table et pas le contenu !
Faut pas plutôt un INDEX plutôt qu'un KEY pour la ligne search ?
 
Statut
N'est pas ouverte pour d'autres réponses.
Haut