本文共 365 字,大约阅读时间需要 1 分钟。
玩大了,数据库密码没了,
编译安装的时候一直报错,没用到my.cnf,用mysql_install_db初始化的,所以,
需要用下面这条命令:mysqld_safe --user=mysql --skip-grant-tables --skip-networking &(执行这条命令时最好把数据库进程kill掉)然后进入数据库:
mysql -uroot -puse mysql;update mysql.user set authentication_string=password('newpasswd) where user='root' ;flush privileges;然后启动mysqld即可使用新密码成功登录
转载于:https://blog.51cto.com/xiaoahehe/2358499