0

I have created a MySQL table with the following code from a tutorial, I just put it into the MySQL console:

CREATE  TABLE `test`.`name` (
  `nameid` INT NOT NULL AUTO_INCREMENT ,
  `firstname` VARCHAR(45) NULL ,
  `lastname` VARCHAR(45) NULL ,
  PRIMARY KEY (`nameid`)
);

INSERT INTO `test`.`name`
(`firstname`,`lastname`)
VALUES
("TheBig","Monster"),
("Guy","Smiley"),
("Big","Bird"),
("Oscar","Grouch"),
("Alastair","Cookie");

With the python script given in the tutorial I am able to print each item.

But when it comes to erase the table, I have tried all possible combinations of:

DROP TABLE `test`
DROP TABLE test
DROP TABLE `test`.`name`

etc, but none will erase it. Moreover, If I use the initial table creation script again, it will add the entries to the table, so I know its a stored table within MySQL but cannot access it, delete it, or list it with: SHOW DATABASES or SHOW TABLES

It is my first afternoon with MySQL, but don't know how to go further if the commands in the MySQL help are not working!

So the summary question is: How to delete / access the table created with the script?

4

1 回答 1

1
drop table test.name;

this should work

于 2013-06-09T15:56:12.083 回答