UJP - Raspberry PiにMySQLをインストールしてみた その2

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  • カテゴリ Raspberry Pi の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - Raspberry PiにMySQLをインストールしてみた その2

Raspberry PiにMySQLをインストールしてみた その2

カテゴリ : 
PC » Raspberry Pi
ブロガー : 
ujpblog 2017/9/27 23:00
 raspberry Piに前回,MySQLをインストールしたので,管理ユーザのrootにパスワード設定を行ってみる.
 まずは,パスワードなしでrootユーザで接続できることを確認.
pi@commet:~ $ mysql -uroot🆑
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 42
Server version: 5.5.57-0+deb8u1 (Raspbian)

Copyright (c) 2000, 2017, 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🆑
Bye
pi@commet:~ $
 管理用のコマンドラインツールを確認.

pi@commet:~ $ which mysqladmin🆑
/usr/bin/mysqladmin
pi@commet:~ $
 mysqladminツールでパスワードを設定.

pi@commet:~ $ /usr/bin/mysqladmin -u root password 'new-password'🆑
pi@commet:~ $
 ここではnew-passwordというパスワードを設定している.もう一度先ほどと同じようにrootユーザで接続して見る.

pi@commet:~ $ mysql -uroot🆑
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
pi@commet:~ $
 パスワードを設定したからか,アクセス拒否される. -pオプションを使ってパスワードを指定する

pi@commet:~ $ mysql -uroot -p🆑
Enter password:🆑
 設定したパスワードを入力する.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.5.57-0+deb8u1 (Raspbian)

Copyright (c) 2000, 2017, 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>
 繋がりました.

トラックバック


広告スペース
Google