1
0

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コマンド(基本)

Posted at

#はじめに
今回は基本的なMySQLコマンドについて紹介します。

#MySQLコマンド
ここからコマンドをどんどん列挙していきます。

・ログイン

# localhostのMySQLサーバに接続する場合
$ mysql -u [ユーザー名] -p

# 外部MySQLサーバに接続する場合
$ mysql -u [ユーザー名] -p -h [host名] -P [ポート番号]

・ログアウト

#複数あるのでいろいろためしてみてください。
mysql > \q
mysql > quit
mysql > exit

・データベースの確認

mysql > show databases;

・データベースの追加

mysql > create database 【追加するDB名】;

・データベースの選択

mysql > use  【選択したいDB名】;

・テーブル一覧の確認

mysql > show tables;

#さいごに
次回の記事で(更新削除など含む)テーブル作成についてまとめたいと思います。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?