11-03-2012, 02:34 PM
Set passwords for the MySQL root account:
mysql_secure_installation
~[root@server1 ~]# mysql_secure_installation ~
Set MYSQL PASS
Isnn't much easyer:
#mysqladmin -u [user] -p password [new password];
And to set the password for the server to connect:
#mysql -u[user] -p[old password] -e "SET PASSWORD FOR [user]@localhost=OLD_PASSWORD('[new password]')";

