1.MySQLを使ってみる。


(1)MySQLの起動の仕方



スタートから次の手順で立ち上げるか

 [スタート]→[プログラム]→[MySQL]→[MySQL Server5.0]→[MySQL Command Line Client]

コマンドプロンプトから

 C:/Documents and Settings\kobori>mysql -u root -pのようにコマンドを打ち込みます。

パスワードを要求されますので、自分で設定したパスワードを入力。
 Enter password:*******

「*******」の部分は自分自身で設定したものを入力します。


起動すると次のように表示されます。

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8 to server version: 5.0.6-beta-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

(2)MySQLに登録されているデータベースを確認する。


コマンド
 show databases;

実行例
mysql> show databases;
+--------------------+
| Database                    |
+--------------------+
| information_schema       |
| mysql                         |
| test                             |
+--------------------+
3 rows in set (0.38 sec)

(3)MySQLにデータベースを作成(追加)する。


コマンド
 create database データベース名;

実行例
 データベースTVDBを作成する

mysql> create database TVDB;
Query OK, 1 row affected (0.03 sec)

 データベースが作成されているか確認してみます。
mysql> show databases;
+--------------------+
| Database                   |
+--------------------+
| information_schema |
| mysql                       |
| test                           |
| tvdb                         |
+--------------------+
4 rows in set (0.00 sec)



戻る
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送