skip-grant-tables:非常有用的mysql启动参数
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost'(using password: NO)
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost'(using password: YES)
地址:https://blog.csdn.net/m_wise/article/details/70196039
顾名思义,就是在启动mysql时不启动grant-tables,授权表。有什么用呢?当然是忘记管理员密码后有用。
操作方法:
1、杀掉原来进行着的mysql:
rcmysqld stop
或者:
service mysqld stop
或者:
kill -TERM mysqld
2、以命令行参数启动mysql:
/usr/bin/mysqld_safe --skip-grant-tables &
3、修改管理员密码:
use mysql;
update user set password=password('yournewpasswordhere') whereuser='root';
flush privileges;
exit;
4、杀死mysql,重启mysql
操作方法:
1、杀掉原来进行着的mysql:
rcmysqld stop
或者:
service mysqld stop
或者:
kill -TERM mysqld
2、以命令行参数启动mysql:
/usr/bin/mysqld_safe --skip-grant-tables &
3、修改管理员密码:
use mysql;
update user set password=password('yournewpasswordhere') whereuser='root';
flush privileges;
exit;
4、杀死mysql,重启mysql