如何使用mysqladmin刪除現有資料庫?


我們需要特殊許可權才能建立或刪除MySQL資料庫。以下是使用mysqladmin 二進位制檔案刪除資料庫的語法 -

語法

[root@host]# mysqladmin -u root -p drop db_name
Enter password:******

此處,db_name是要刪除的資料庫的名稱。

例項

以下是一個刪除名為TUTORIALS的資料庫的示例 -

[root@host]# mysqladmin -u root -p drop TUTORIALS
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 'TUTORIALS' database [y/N] y
Database "TUTORIALS" dropped

更新於:2020年6月20日

106次瀏覽

開啟您的 職業生涯

透過完成課程獲得認證

開始
廣告
© . All rights reserved.