changing mysql password via java
- by Osama Abukmail
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