2014年7月19日土曜日

MySQLのsecure_authエラー

Original post: http://anothermysqldba.blogspot.com/2014/07/mysql-secureauth-error.html

私はこの中のときに、ブロックの複製の前にsecure_authのエラーに対処してブログの記事  

しかし、私は、MySQLクライアントを経由して接続するとき、私はこのブログは、より一般的な修正を投稿することと考えました。これは、MySQL 5.6の前にサーバー用です。 

あなたはsecure_authエラーが出るのであればMySQLへの接続次の手順は、このエラーをクリアする必要があります。 

+---------------+-------------------------------------------+ 
| User | Password | 
+---------------+-------------------------------------------+ 
| authdtestuser | 34d22ac342c35af2
 +---------------+-------------------------------------------+ 
| User | Password | 
+---------------+-------------------------------------------+ 
| authdtestuser | 34d22ac342c35af2 | |+---------------+-------------------------------------------+ 

SELECT @@session.old_passwords, @@global.old_passwords; +-------------------------+------------------------+ 
| @@session.old_passwords | @@global.old_passwords | 
+-------------------------+------------------------+ 
| 1 | 1 | 
+-------------------------+------------------------+ 

mysql> SET @@session.old_passwords = 0; SET @@global.old_passwords=0; 
Query OK, 0 rows affected (0.00 sec) 

mysql> SELECT @@session.old_passwords, @@global.old_passwords; 
+-------------------------+------------------------+ 
| @@session.old_passwords | @@global.old_passwords | 
+-------------------------+------------------------+ 
| 0 | 0 | 
+-------------------------+------------------------+ 
1 row in set (0.00 sec) 

mysql> SET PASSWORD FOR 'authdtestuser'@'localhost' = PASSWORD('sshthisisasecret'); 
Query OK, 0 rows affected (0.00 sec) 

mysql> select User , Password from mysql.user where User = 'authdtestuser'; 
+---------------+-------------------------------------------+ 
| User | Password | 
+---------------+-------------------------------------------+ 
| authdtestuser | *E48BD8BF1B9F29459E5284AD158443B5B33B70E4 | 
+---------------+-------------------------------------------+ 
1 row in set (0.00 sec) 

mysql> SET @@session.old_passwords = 1; SET @@global.old_passwords=1; 

mysql> SELECT @@session.old_passwords, @@global.old_passwords; 
+-------------------------+------------------------+ 
| @@session.old_passwords | @@global.old_passwords | 
+-------------------------+------------------------+ 
| 1 | 1 | 
+-------------------------+------------------------+ 
1 row in set (0.00 sec) 
| |+---------------+-------------------------------------------+ 

SELECT @@session.old_passwords, @@global.old_passwords; +-------------------------+------------------------+ 
| @@session.old_passwords | @@global.old_passwords | 
+-------------------------+------------------------+ 
| 1 | 1 | 
+-------------------------+------------------------+ 

mysql> SET @@session.old_passwords = 0; SET @@global.old_passwords=0; 
Query OK, 0 rows affected (0.00 sec) 

mysql> SELECT @@session.old_passwords, @@global.old_passwords; 
+-------------------------+------------------------+ 
| @@session.old_passwords | @@global.old_passwords | 
+-------------------------+------------------------+ 
| 0 | 0 | 
+-------------------------+------------------------+ 
1 row in set (0.00 sec) 

mysql> SET PASSWORD FOR 'authdtestuser'@'localhost' = PASSWORD('sshthisisasecret'); 
Query OK, 0 rows affected (0.00 sec) 

mysql> select User , Password from mysql.user where User = 'authdtestuser'; 
+---------------+-------------------------------------------+ 
| User | Password | 
+---------------+-------------------------------------------+ 
| authdtestuser | *E48BD8BF1B9F29459E5284AD158443B5B33B70E4 | 
+---------------+-------------------------------------------+ 
1 row in set (0.00 sec) 

mysql> SET @@session.old_passwords = 1; SET @@global.old_passwords=1; 

mysql> SELECT @@session.old_passwords, @@global.old_passwords; 
+-------------------------+------------------------+ 
| @@session.old_passwords | @@global.old_passwords | 
+-------------------------+------------------------+ 
| 1 | 1 | 
+-------------------------+------------------------+ 
1 row in set (0.00 sec)