2016-10-08 9 views
3

私が使用して、任意のパスワードを使用して、rootユーザとしてログインすることができますなぜ誰かが私に説明できます:パスワードでmysql rootにログインできるのはなぜですか?

sudo mysql -u root -p

を(私はパスワードプロンプトで何も入力することができ、それはとにかく私を記録します)

をマイ/root/.my.cnf

[client] 
user=root 
password=password123 

答えて

0

「Unixソケット認証」プラグインがシステムでデフォルトで有効になっている可能性があります。これは、例えばDebian 9の "Stretch"の場合のようです。私のシステムで

/etc/mysql/mariadb.conf.d/50-server.cnf設定ファイルの状態:

# * Unix socket authentication plugin is built-in since 10.0.22-6 
# 
# Needed so the root database user can authenticate without a password but 
# only when running as the unix root user. 
# 
# Also available for other users if required. 
# See https://mariadb.com/kb/en/unix_socket-authentication-plugin/ 
関連する問題