macos 10.2 MySQL newbie
Posted: Tue Aug 10, 2004 6:39 pm
I managed to get the mySQL> prompt up. I did the following from the manual but don't know why I got the error.
mysql> CREATE TABLE shop (
-> article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' Not Null,
-> dealer CHAR(20) DEFAULT '' NOT NULL,
-> article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
-> price DOUBLE(16,2) DEFAULT '' NOT NULL,
-> PRIMARY KEY(article, dealer));
ERROR 1060: Duplicate column name 'article'
Then I inserted some values and did this one:
mysql> SELECT * FROM shop;
ERROR 1146: Table 'test.shop' doesn't exist
Why doesn't my table exist. Why does it say test.shop doesn't exist because I just created it as shop?
Also, I succeeded in moving a test database world.sql I downloaded into the mysql directory. I did this command:
mysql> SELECT * FROM world.sql
and didn't get a response.
I would like to send some kind of queries to get a response from mysql.
Thanks,
mysql> CREATE TABLE shop (
-> article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' Not Null,
-> dealer CHAR(20) DEFAULT '' NOT NULL,
-> article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
-> price DOUBLE(16,2) DEFAULT '' NOT NULL,
-> PRIMARY KEY(article, dealer));
ERROR 1060: Duplicate column name 'article'
Then I inserted some values and did this one:
mysql> SELECT * FROM shop;
ERROR 1146: Table 'test.shop' doesn't exist
Why doesn't my table exist. Why does it say test.shop doesn't exist because I just created it as shop?
Also, I succeeded in moving a test database world.sql I downloaded into the mysql directory. I did this command:
mysql> SELECT * FROM world.sql
and didn't get a response.
I would like to send some kind of queries to get a response from mysql.
Thanks,