1、創(chuàng)建數(shù)據(jù)庫:create Database databaseName;例如需要創(chuàng)建mysqlTest數(shù)據(jù)庫,create Database mysqlTest;
由此還可以看出,這里的名稱是不分大小寫的,據(jù)我所知可以通過設置設置為全大些或者全小寫。
2、查看系統(tǒng)中已經(jīng)存在的數(shù)據(jù)庫:show databases;
3、選擇數(shù)據(jù)庫:use databaseName;(本文中所有databaseName均是一個代稱,表示數(shù)據(jù)庫名稱,tableName也是代稱,表示表名);
4、刪除數(shù)據(jù)庫:drop database databaseName;
5、查看數(shù)據(jù)庫引擎:show engines ?G
支持的引擎比較多,因此這里屏幕截圖就不完整。
6、查看數(shù)據(jù)庫默認存儲引擎:show variables like ‘storage_engine%’;
7、查看系統(tǒng)幫助:help contents;
8、創(chuàng)建表:create table tableName(
? ?屬性名 數(shù)據(jù)類型,
? ?屬性名 數(shù)據(jù)類型,
? ?……
)
9、查看表結構:describe tableName;
10、刪除表:drop table tableName;
?以上就是mysql常用基礎操作語法(一)~~對庫的操作【命令行模式】的內(nèi)容,更多相關內(nèi)容請關注php中文網(wǎng)(www.php.cn)!