匿名用户
1级
2016-11-18 回答
linux下mysql如何查询用户的密码
linux忘记mysql密码处理方法,下面提供了5种linux忘记mysql密码找回方法哦。
方法一:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> update user set password=password('newpassword') where user='root';
mysql> flush privileges;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
enter password:
mysql>
方法二:
直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
enter password:
mysql> update user set password=password('newpassword') where user='root';
mysql> flush privileges;
mysql> quit
# mysql -uroot -p
enter password:
mysql&g