0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【MySQL】DBの削除方法:Mac

Posted at

概要

アプリを作成していくとDBも溜まっていく。。。。
古いDBは削除してスッキリさせたい:sparkles:
そんな方、必見!DBを簡単に削除する方法です

手順

①MySQLへログイン

ターミナル
$ mysql -uroot

②削除のコマンドを打つ

ターミナル
$  drop database データベース名;

:warning:DB名に"-"(ハイフン)がついている場合は下記のコマンドです

ターミナル
$  drop database 'データベース名';

''を忘れずに!!

おまけ

●データベース一覧を表示

ターミナル
$  show database;

●データベースの作成

ターミナル
$  create database データベース名;

参考

●データベース削除
https://qiita.com/nanatsu/items/33b57238b0e9ae0a1c78
●MySQLへのログイン
https://qiita.com/fuwamaki/items/194c2a82bd6865f26045
●-を含めたDBの処理
https://www.na3.jp/entry/20090128/p1

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?