Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 897
Ricardo Avatar asked Oct 19 '22 13:10

Ricardo


1 Answers

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 documentation: MySQL password hashing

like image 127
Ricardo Avatar answered Oct 29 '22 04:10

Ricardo