1、假如之前没设置密码,现在想成test
mysqladmin -u root password test
2、假如之前密码是1234,现在想改成test
mysqladmin -u root -p1234 password test
注:-p后面如果带空格,会提示让输入密码,输入1234后,就修改成test。重启mysql生效
详情参考:http://www.linuxidc.com/Linux/2014-01/95638.htm
===========================
修改密码后客户端如果不能登录,需要grant权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'test';
FLUSH PRIVILEGES;
http://blog.csdn.net/wengyupeng/article/details/3290415
=============================
---
开心工作,认真生活;回望来时路,脚印三两,笑声无数...
开心工作,认真生活;回望来时路,脚印三两,笑声无数...