
ローカルMySqlサーバーがあります。開始され、次のローカルユーザーを使用してアクセスできます。
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 66
Server version: 5.5.34-0ubuntu0.13.04.1 (Ubuntu)
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> exit
大丈夫です。ただし、rootを使用しようとすると、次のメッセージが表示され続けます。
$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
どういう意味ですか?この問題をどのように解決できますか?
編集する
これも機能しません(実行後sudo mysql_install_db
)。
$ /usr/bin/mysqladmin -u root password 'MyPass'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
答え1
試してみてください
mysql -u root -p
パスワードプロンプトが表示されます。
これがうまくいかない場合は、以下を参照してください。https://stackoverflow.com/questions/11760177/access-denied-for-root-user-in-mysql-command-line