2016年2月7日日曜日

[solve]ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql-5.7.10-osx10.10-x86_64.dmg

MacOS Yosemite 10.10.5で動作するmysql-5.7.10-osx10.10-x86_64.dmgをインストールして、mysqlコマンドでデータベースを確認したところ以下の様になった。

mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

¥sしてもrootパスワードの変更を勧められる。

mysql> \s
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.

ALTER USERでrootのパスワードを変更して解決した。

mysql>ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

変更後はmysqlのコマンドが実行できる。

mysql> \s
--------------
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.7.10, for osx10.9 (x86_64) using  EditLine wrapper

Connection id:        97
Current database:
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        5.7.10
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    utf8
Conn.  characterset:    utf8
UNIX socket:        /tmp/mysql.sock
Uptime:            3 hours 48 min 3 sec

Threads: 1  Questions: 11  Slow queries: 0  Opens: 106  Flush tables: 1  Open tables: 99  Queries per second avg: 0.000
-------------

詳細なバージョンは以下の通り。

/usr/local/mysql/bin/mysql -V
/usr/local/mysql/bin/mysql  Ver 14.14 Distrib 5.7.10, for osx10.9 (x86_64) using  EditLine wrapper

ここからダウンロードしたが、表示上は10.9となっている。

http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-osx10.10-x86_64.dmg

0 件のコメント: