Commands are not case sensitive but DB names are. If you use names like table or column more than once in a command, the casing must be consistent, so you might as well stick to the convention of typing commands in ALLCAPS.
mysql -u root -p
***************************
mysql> SHOW DATABASES;
mysql> CREATE DATABASE acid;
mysql> USE acid;
mysql> CREATE TABLE hits (
-> id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> acidtext TEXT,
-> acidyear DATE NOT NULL,
-> ) DEFAULT CHARACTER SET utf8;
mysql> SHOW TABLES;
mysql> DESCRIBE hits; //this will show the table with the field names
mysql> DROP TABLE hits;
mysql> DROP DATABASE acid;
*************************************
\c+ENTER to cancel out of what you are typing.
mysql> quit (or exit)
mysql -u root -p
***************************
mysql> SHOW DATABASES;
mysql> CREATE DATABASE acid;
mysql> USE acid;
mysql> CREATE TABLE hits (
-> id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
-> acidtext TEXT,
-> acidyear DATE NOT NULL,
-> ) DEFAULT CHARACTER SET utf8;
mysql> SHOW TABLES;
mysql> DESCRIBE hits; //this will show the table with the field names
mysql> DROP TABLE hits;
mysql> DROP DATABASE acid;
*************************************
\c+ENTER to cancel out of what you are typing.
mysql> quit (or exit)
No comments:
Post a Comment