changing mysql password via java

Posted by Osama Abukmail on Stack Overflow See other posts from Stack Overflow or by Osama Abukmail
Published on 2013-11-02T09:32:59Z Indexed on 2013/11/05 3:55 UTC
Read the original article Hit count: 165

Filed under:
|
|

I'm trying to change a user's password on mysql using java, i successfully changed it on phpmyadmin but same command doesnt work on java

SET PASSWORD = PASSWORD('12345')

this command will change the current logged in user, i have tried it on java like this

statement = connect.createStatement();
statement.executeUpdate("SET PASSWORD = PASSWORD('12345')");

but nothing happened

i also tried this with root logged in

statement = connect.createStatement();
statement.executeUpdate("SET PASSWORD FOR 'username'@'localhost' = PASSWORD('123456')");

and nothing work,, any help please

© Stack Overflow or respective owner

Related posts about java

Related posts about mysql