修改/etc/my.cnf,加上skip-grant-tables,重启服务
/etc/my.cnf
skip-grant-tables
但是这个会和在my.cnf中指定port冲突,使得指定port无效。
修改/etc/my.cnf,添加以下内容
[client] user=root password=password
重启服务
如果觉得这太容易泄露了,可以chmod 400 my.cnf只让自己可读
chmod 400 my.cnf
Last updated 2 years ago