Ricardo Ricardo - 1 month ago 27
Java Question

How to fix java.sql.SQLException: Server is running in --secure-auth mode, but 'user'@'host' has a password in the old format; (...)?

After upgrading MySQL 5.1 to 5.6, trying to start JBoss failed with this exception:

java.sql.SQLException:
Server is running in --secure-auth mode, but 'user'@'localhost'
has a password in the old format; please change the password to the new format


How to fix this issue?

Answer

This issue was fixed by:

1) Update the value of the password hash of the 'user' user

UPDATE mysql.user set password = PASSWORD('my password text') where user= 'user';

2) Stop 'mysql' server

/etc/init.d/mysql stop

3) Set the flag old_passwords=1 on the /etc/my.cnf file

4) Start 'mysql' server

/etc/init.d/mysql start

See also: MySQL password hashing

Comments