Ich habe (wie fast alle hier) ein Problem mit dem Wiederherstellen eines Dumps einer meiner Datenbanken.
per
- Code: Select all
mysqldump --quick -h HOST -u USER -pPW --quote-names --compress DB106779 > dbbackup/DB106779.sql
Habe ich den Dump erstellt und versuche ihn nun mit
- Code: Select all
mysql -h HOST -u USER -pPW DB80998 < dbbackup/DB106779.sql
versuchsweise in eine leere Datenbank einzuspielen.
Dabei bekomme ich folgenden Fehler:
- Code: Select all
ERROR 1170 (00000) at line 10: BLOB column 'text' used in key specification with out a key length
Der betreffende Teil aus dem Dump sieht wie folgt aus:
- Code: Select all
#
# Table structure for table 'ToDo'
#
CREATE TABLE `ToDo` (
`id` int(11) NOT NULL auto_increment,
`text` text DEFAULT '' NOT NULL,
`view` varchar(5) DEFAULT 'true' NOT NULL,
`order` int(11) DEFAULT '0' NOT NULL,
`done` int(11) DEFAULT '0' NOT NULL,
`editor` varchar(45),
PRIMARY KEY (id,id),
KEY text (text)
);
Das bedeutet meinen Nachforschungen auf dev.mysql.com zufolge, dass MySql bemängelt, dass die 'text' Spalte als text angelegt wurde und so keine Längenangabe hat; die Längenangabe aber benötigt wird.
Mir war bisher nicht bekannt dass der Typ 'text' eine Längenangabe benötigt, weil er doch variabel lang sein soll. (Die Tabelle wurde damals per PhPMyAdmin erstellt und hat ihren Dienst auch erfüllt)
Ich frage mich nun wie ich den Fehler beheben kann, um später (im Notfall) sicher zu sein, dass ich ohne große Probleme mein Backup aufspielen kann.
Über eine Antwort würde ich mich sehr freuen,
MfG Philipp Tessenow
[edit]
Oh. Ich sehe gerade, das ich die Worte "key specification" überlesen habe. Also werde ich dem entsprechend mal versuchen den Key auf 'text' nicht zu setzen.
[/edit]
Ok nun besteht ebendies Problem immernoch mit einer Tabelle:
- Code: Select all
ERROR 1170 (00000) at line 6361: BLOB column 'description' used in key specification without a key length
Der betreffende Teil der SQL-Datei:
- Code: Select all
CREATE TABLE `mambo_downloads_files` (
`id` int(11) NOT NULL auto_increment,
`sequence` int(11) DEFAULT '0' NOT NULL,
`windowtitle` varchar(255) DEFAULT '' NOT NULL,
`realname` varchar(255) DEFAULT '' NOT NULL,
`islocal` tinyint(3) unsigned DEFAULT '1' NOT NULL,
`containerid` smallint(6) DEFAULT '0' NOT NULL,
`filepath` varchar(255) DEFAULT '' NOT NULL,
`filesize` varchar(255) DEFAULT '' NOT NULL,
`filetype` varchar(255) DEFAULT '' NOT NULL,
`filetitle` varchar(255) DEFAULT '' NOT NULL,
`description` text DEFAULT '' NOT NULL,
`smalldesc` text DEFAULT '' NOT NULL,
`autoshort` tinyint(3) unsigned DEFAULT '1' NOT NULL,
`license` text DEFAULT '' NOT NULL,
`licenseagree` tinyint(3) unsigned DEFAULT '0' NOT NULL,
`price` int(11) DEFAULT '0' NOT NULL,
`currency` char(3) DEFAULT '' NOT NULL,
`downloads` int(11) DEFAULT '0' NOT NULL,
`url` varchar(255) DEFAULT '' NOT NULL,
`icon` varchar(50) DEFAULT '' NOT NULL,
`published` tinyint(3) unsigned DEFAULT '1' NOT NULL,
`registered` tinyint(3) unsigned DEFAULT '2' NOT NULL,
`userupload` tinyint(3) unsigned DEFAULT '3' NOT NULL,
`recommended` tinyint(3) unsigned DEFAULT '0' NOT NULL,
`recommend_text` text DEFAULT '' NOT NULL,
`featured` tinyint(4) DEFAULT '0' NOT NULL,
`featured_st_date` date DEFAULT '2000-01-01' NOT NULL,
`featured_end_date` date DEFAULT '2000-01-01' NOT NULL,
`featured_priority` smallint(6) DEFAULT '0' NOT NULL,
`featured_seq` smallint(6) DEFAULT '0' NOT NULL,
`featured_text` text DEFAULT '' NOT NULL,
`opsystem` varchar(50) DEFAULT '' NOT NULL,
`legaltype` varchar(50) DEFAULT '' NOT NULL,
`requirements` text DEFAULT '' NOT NULL,
`company` varchar(255) DEFAULT '' NOT NULL,
`releasedate` date DEFAULT '1000-01-01' NOT NULL,
`languages` text DEFAULT '' NOT NULL,
`company_URL` varchar(255) DEFAULT '' NOT NULL,
`translator` varchar(255) DEFAULT '' NOT NULL,
`fileversion` varchar(50) DEFAULT '' NOT NULL,
`fileauthor` varchar(100) DEFAULT '' NOT NULL,
`author_URL` varchar(255) DEFAULT '' NOT NULL,
`filedate` datetime DEFAULT '2000-01-01 00:00:00' NOT NULL,
`filehomepage` varchar(255) DEFAULT '' NOT NULL,
`screenurl` varchar(255) DEFAULT '' NOT NULL,
`plaintext` tinyint(3) unsigned DEFAULT '0' NOT NULL,
`isblob` tinyint(3) unsigned DEFAULT '0' NOT NULL,
`groupid` smallint(6) DEFAULT '0' NOT NULL,
`submittedby` mediumint(9) DEFAULT '0' NOT NULL,
`submitdate` datetime DEFAULT '2000-01-01 00:00:00' NOT NULL,
UNIQUE id (id),
KEY filetitle (filetitle),
KEY realname (realname),
KEY url (url),
KEY containerid (containerid,published),
KEY recommended (containerid,recommended,published),
KEY featured (containerid,featured,published,featured_st_date,featured_end_date),
KEY opsystem (containerid,opsystem,published),
KEY filetitle_2 (filetitle,description,smalldesc,fileauthor)
);
Der Spaß an der Geschichte ist nun natürlich, dass das ein Joomla Table ist (heißt nur aus historischen Gründen noch Mambo). Und ich schätze, dass sich die Joomla-Entwickler schon was beim setzen der Indizes gedacht haben (mehr als das bei dem Table oben, den ich selbst erstellt hatte, war).
Also kommt die Lösung mit dem Löschen des Key-Eintrags nun für mich nicht in Frage.
Gibt es eine andere Lösung?
MfG, P. Tessenow