#1051 - Unknown table

DaSilva

Registered User
Ich kann unter MySQL 4.1 eine Datenbank nicht löschen (trotz root) weil er mir sagt

#1051 - Unknown table 'allystatus,bgb1_smilies,online,bgb1_replace,bgb1_fieldsettings,statistik,units,bgb1_templates,troupe'

Irgendwie war da vorher was drin was jetzt nicht mehr drin ist und das will er erst überprüfen bevor er die ganze Datenbank löscht!?

Mit phpMyAdmin 2.7 versucht.

Bitte um Hilfe!

Danke
 
Log Dich mal ueber die Console ein.
Code:
mysql -u root -p
Dann in die Datenbank wechseln, wo die Tabellen drin sind/sein sollen:
Code:
USE xxxx;
Dann mal schauen, was wirklich drin ist:
Code:
SHOW TABLES;

Wenn die Tabellen da noch vorhanden sind, einfach manuell loeschen:
Code:
DROP table1, table2, ..., tablen;

Naehere Informationen findest Du hier: DROP TABLE Syntax

Cheers,
Henning
 
mysql> SHOW TABLES;
+-----------------------------------+
| Tables_in_mgoeres2_ |
+-----------------------------------+
| chc_access |
| chc_config |
| chc_counted_users |
| chc_data |
| chc_downloads_and_hyperlinks |
| chc_downloads_and_hyperlinks_logs |
| chc_ignored_users |
| chc_locale_information |
| chc_log_data |
| chc_online_users |
| chc_pages |
| chc_referrers |
| chc_screen_resolutions |
| chc_search_engines |
| chc_user_agents |
+-----------------------------------+
15 rows in set (0.01 sec)

mysql> DROP chc_access, chc_config, chc_counted_users, chc_data, chc_downloads_and_hyperlinks, chc_downloads_and_hyperlinks_logs, chc_ignored_users, chc_locale_information, chc_log_data, chc_online_users, chc_pages, chc_referrers, chc_screen_resolutions, chc_search_engines, chc_user_agents, tablen;
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 'chc_access, chc_config, chc_counted_users, chc_data, chc_downloads_and_hyperlink' at line 1
 
Ähm, tablen sollte soviel heissen wie von table 1 bis table n. Auch wenn ich im Moment glaube, dass das nicht das Problem ist, entferne bitte das "tablen" am Ende.

Wie wäre es, wenn Du die Tabellen einzeln droppest (ich liebe Denglish :cool:) und dann schaust, welche Stress macht?
 
mysql> DROP chc_access;
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 'chc_access' at line 1
mysql>

MySQL 4.1.13
 
Mal die Glaskugel bemühen, denn die Beschreibung der Errormeldung bringt mich auch net weiter. mysql-manual sagt dazu: (ER_PARSE_ERROR) Großartig!

Kannst Du ein SELECT * FROM chc_access; ausführen?
Wenn ja, könnte es natürlich sein, dass Foreign Keys gesetzt sind, aber nun muss ich zugeben, darf sich gerne ein SQL-Experte einschalten, ansonsten muss ich Manuals welzen, wie man das rausfindet und ob das in mySQL überhaupt geht (bestimmt..).

Wenn nein, kann es sein, dass der Name der Tabelle evtl. "chc_access " ist, also mit Leerzeichen dahinter.

Edit:
You can also display the foreign key constraints for a table like this:
SHOW TABLE STATUS FROM db_name LIKE 'tbl_name';
The foreign key constraints are listed in the Comment column of the output
 
Last edited by a moderator:
Und was ist mit:mysqladmin
Code:
mysqladmin drop db_name
db_name ist durch den tatsächlichen Namen der Datenbank zu ersetzten.

Gruß flyingoffice
 
DaSilva said:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax

Die Synrax ist nicht ganz weit von den meisten SQL Dialekten weg (behauptet auch das "manual"), i.d.R. folgt der Aktion"drop" der Objekttyp "table" und dann der Name:
DROP [TEMPORARY] TABLE [IF EXISTS]
tbl_name [, tbl_name] ...
[RESTRICT | CASCADE]
Siehe auch
http://dev.mysql.com/doc/refman/5.0/en/drop-table.html

btw. Kommt vielleicht auch drop database in Frage?
http://dev.mysql.com/doc/refman/5.0/en/drop-database.html

Ciao,
Mercy.
 
Back
Top