今日の人気記事

  1. MySQLのダウンロードとインストール - Windows環境
  2. MySQLサービスの開始と停止 - Windows環境

MySQLの初期設定と動作確認 - Windows環境

当ページのリンクには広告が含まれています。

スポンサーリンク

Windows環境にインストールしたMySQLの初期設定と動作確認方法を紹介します。

MySQLの初期設定 - 環境変数の設定

MySQLのbinコマンドが簡単に使えるようにパスを通します(環境変数を設定します)。環境変数についてはこちらを参考にしてください。

スポンサーリンク

windows-mysql-confirmation-00
システムのプロパティから「環境変数の設定」をクリックします。

windows-mysql-confirmation-01
システム環境変数のPath変数を選択し、「編集」をクリックします。

windows-mysql-confirmation-02
Path変数に「;C:¥Program Files¥MySQL¥MySQL Server 5.6¥bin」を追加し、「OK」をクリックします。

windows-mysql-confirmation-03
これで環境変数の設定は完了です。「OK」をクリックします。

MySQLの動作確認

Windows版のインストーラで、MySQLをインストールすると「mysql56」という名前でWindowsサービスに登録されています。

管理者としてコマンドプロンプトを起動し、MySQLサービスを起動し、サーバーへ接続してみましょう。

windows-mysql-confirmation-10

C:¥Windows¥system32>net start mysql56 ← MySQLサービスを開始
MySQL56 サービスを開始します.
MySQL56 サービスは正常に開始されました。

C:¥Windows¥system32>mysql -u root -p ← rootユーザーでMySQLサーバーへ接続
Enter password: **** ← インストール時に設定したパスワードを入力
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.12 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit; ← MySQLサーバーとの接続を切断
Bye

mysqlのプロンプト(mysql>)が表示されれば、MySQLサーバーへ適切に接続できています。quitコマンドを入力するとMySQLサーバーとの接続が断たれます。

これで動作確認は完了です。

スポンサーリンク

関連記事(一部広告含む)