I am running MySQLserver version 5.0.96 on SLES 11 SP2 and I am looking for a safe way to change the user password. Of course, changing the user password is very easy:
SET PASSWORD FOR 'user'@'192.168.0.%' = PASSWORD('mysecret');
But this query gets into the query log, binary log and MySQL history file. To prevent this, I used:
export MYSQL_HISTFILE=/dev/null
before starting the client and:
SET sql_log_bin = 0; SET sql_log_off = 1;
then. Grep and mysqlbinlog prove that my plan is coming together, but I overlooked that MySQL quietly changed the file mode bit / dev / null to 0600. Oops!
At this point, I asked myself if there is a better way to safely change the user password. And now I ask you:
What is the best way to securely change a user password for a MySQL server?
source share