您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

忘记mysql root密码的解决办法_MySQL

2025/3/19 5:53:03发布35次查看
bitscn.com windows下1,停止mysql服务,cmd打开dos窗口,输入 net stop mysql2,在cmd命令行窗口,进入mysql安装目录 比如 d:/mysql/bin3,跳过mysql权限检查表,即当mysql起来后,不用输入密码就能进入数据库。命令为: mysqld-nt --skip-grant-tables4,重新打开一个cmd命令行窗口,输入mysql -uroot -p,使用空密码的方式登录mysql(不用输入密码,直接按回车)5,输入以下命令开始修改root用户的密码  mysql> update mysql.user set password=password('newpass') where user='root';6,刷新权限表mysql> flush privileges;7,退出mysql> quit
linux 下1.shell>whereis mysqld_safe
2.shell>path/to/mysqld_safe --skip-grant-tables
3.打开新终端  shell>mysql -uroot -p,空密码登录mysql
4.mysql> update mysql.user set password=password('newpass') where user='root'
5.mysql> flush privileges;/q
6.mysqladmin -uroot -p'newpass' shutdown 关闭mysql服务 bitscn.com    
 以上就是忘记mysql root密码的解决办法_mysql的内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product