SHOW
mysql>SHOW DATABASES;
mysql>SHOW TABLES FROM databaseName;
mysql>SHOW COLUMNS FROM databaseName.tableName;
USE
mysql>USE databaseName
mysql 把 USE
歸於一種命令,可以不加 ;
結尾。
mysql>SHOW TABLES;
mysql>SHOW COLUMNS FROM tableName;
SELECT
mysql>SELECT 8*8;
mysql>SELECT VERSION() AS version, CURRENT_DATE AS today, USER() AS user, ROUND(PI(),4) AS pi;
mysql>SELECT DATABASE();
mysql>SELECT * FROM tableName;
mysql>SELECT * FROM databaseName.tableName;
shell>mysql -u root -e "SELECT * FROM databaseName.tableName;"
提示字元 | 說明 |
---|---|
mysql> | 準備輸入新的命令 |
-> | 接續前一行,等候輸入未完整的命令 |
'> | 接續前一行,等候輸入關閉的單引號「' 」 |
"> | 接續前一行,等候輸入關閉的雙引號「" 」 |
`> | 接續前一行,等候輸入關閉的反引號「` 」 |
/*> |
接續前一行,等候輸入關閉的註解「*/ 」 |
更新日期: