viernes, 18 de julio de 2014

Error MySQL secure_auth

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

Me dirigí a los errores secure_auth antes cuando la replicación se bloquea en esta entrada del blog . 

Sin embargo, pensé que iba a hacer este blog publicar una solución más general cuando se conecta a través de clientes de MySQL.Esto es para los servidores antes de MySQL 5.6. 

Así que si usted consigue un error secure_auth cuando la conexión a MySQL los siguientes pasos debe eliminar este error. 

+---------------+-------------------------------------------+ 
| 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)