change the password of mysql

path:
/opt/FlexMaster/3rdparty/mysql/mysql-enterprise-5.0.52-linux-x86_64-glibc23/bin
commend:
[root@itms2 bin]# ./mysqldump -uroot -p --socket=../mysql.sock mysql user > user
[root@itms2 bin]# vim user

edit the 'user' by vi:

LOCK TABLES `user` WRITE;/*!40000 ALTER TABLE `user` DISABLE KEYS */;INSERT INTO `user` VALUES ('localhost','root','*4ACFE3202A5FF5CF467898FC58AAB1D615029441','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0),('itms2.ruckus.com','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0),('127.0.0.1','root','*4ACFE3202A5FF5CF467898FC58AAB1D615029441','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0),('localhost','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0),('itms2.ruckus.com','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0),('%','root','*4ACFE3202A5FF5CF467898FC58AAB1D615029441','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);/*!40000 ALTER TABLE `user` ENABLE KEYS */;UNLOCK TABLES;/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

[root@itms2 bin]# ./mysql -uroot -p --socket=../mysql.sock mysql <>
[root@itms2 bin]# ./mysqladmin -uroot -p --socket=../mysql.sock flush-privilegesvim

沒有留言:

張貼留言