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

After upgrading MySQL from 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 do I fix this problem?

+3


source to share


4 answers


This issue has been fixed:

1) Update password hash value of user 'user'

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

2) Stop the "MySQL" server

/etc/init.d/mysql stop



3) Set the flag old_passwords=1

in the file/etc/my.cnf

4) Start the MySQL server

/etc/init.d/mysql start

See also documentation: MySQL password hashing

+2


source


First, you need to find the file my.cnf

, which should be in the following path:

MySQL Server 5.6\my.cnf

      

Next, find the line that says old_passwords=0

and change it to old_passwords=1

. This will allow MySQL to use a 4.0 compatible password hashing algorithm that your use case covers.



Now when you start your server the password problem should be gone. If you want to update your passwords to the latest version, you can use SET PASSWORD

for each user with a flag old_passwords=0

.

Please keep in mind that MySQL has updated its password algorithm for security reasons, so you shouldn't consider setting old_passwords=1

it up as a long term solution.

See here for details .

+2


source


Reset the password for the JBOSS user to the same password as before. The new MySQL version will hash with a new strong algorithm and it will start working again.

0


source


In my case, the password was incorrect. Instead of how dbname_userName

I just gave it userName

. After re-checking the username, password, etc. I fixed them and executed successfully.

-1


source







All Articles