mysql的几个操作
1、忘记密码,从控制台免密码登录:
修改/etc/my.cnf,[mysqld]下加一行:skip-grant-tables
重启mysql: /etc/init.d/mysqld restart
命令行免密登录:bin/mysql
2、用update修改密码,由于mysql的版本问题,选下面两种之一。别忘了flush privileges:
update user set password=password("new_pass") where user="root"; update user set authentication_string=password("new_pass") where user="root";