MySQLへのログイン
ターミナルソフトでサーバにログイン後、mysqlコマンドでMySQLに接続する。
|
1 |
mysql -u ユーザ名 -h サーバ名 -p |
-uでユーザ名を指定し、-hでホスト名(サーバ名)を指定する。-pオプションだけつけると、パスワードの入力を求められる。さくらサーバでMySQLをインストール済みの場合は以下の通り。
|
1 |
mysql -u ユーザ名 -h mysql???.db.sakura.ne.jp -p |
パスワード入力に成功すると、mysql>プロンプトが表示される。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
% mysql -u [ユーザ名] -h mysql???.db.sakura.ne.jp -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 593501130 Server version: 5.5.38-log Source distribution 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> |
MySQLからのログアウト
mysql>プロンプトに対してquitまたはexitで終了。
|
1 2 3 |
mysql> quit Bye % |
|
1 2 3 |
mysql> exit Bye % |
quitの代わりに\qでも終了できる。