[root@host]# mysqladmin -u root -p drop yiibai Enter password:****** 這會給出一個警告,它會確認你是否真的要刪除這個數據庫或不刪除。 Dropping the database is potentially a very bad thing to do. Any data stored in the database will be destroyed.
Do you really want to drop the 'yiibai' database [y/N] y Database "yiibai" dropped 或使用: mysql> drop database yiibai; Query OK, 0 rows affected (0.01 sec) 使用下面命令看刪除后,數據庫的列表情況: mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | test | | yiibai | +--------------------+ 6 rows in set (0.00 sec) 2、使用PHP腳本刪除數據庫PHP使用mysql_query()函數來創建或刪除MySQL數據庫。該函數有兩個參數,成功返回TRUE或失敗返回FALSE。語法: bool mysql_query( sql, connection );