最好用的mysql密码忘记的解决方法_MySQL
bitsCN.com
在windows下:
打开命令行窗口,停止mysql服务:
Net stop mysql
启动mysql,一般到mysql的安装路径,找到 mysqld-nt.exe (或mysqld.exe)
执行:mysqld-nt (或mysqld.exe) --skip-grant-tables 当前窗口将会停止。
另外打开一个命令行窗口,执行mysql 如果提示没有这个命令,先进入MYSQL的安装位置下BIN目录再运行mysql
>use mysql >update user set password=password("new_password") where user="root"; >flush privileges; >exit
用Ctrl+Alt+Del,找到mysqld-nt的进程杀掉它,在重新启动mysql-nt服务,就可以用新密码登录了
在linux下:
如果 MySQL 正在运行,首先杀之: killall -TERM mysqld。
启动 MySQL :bin/safe_mysqld --skip-grant-tables &
就可以不需要密码就进入 MySQL 了。
然后就是
>use mysql >update user set password=password("new_pass") where user="root"; >flush privileges;
重新杀 MySQL ,用正常方法启动
用相同版本的MYSQL库替换:(一定要先备份)
1,重新在另一台电脑上安装相同版本的MySQL
2,删除忘记密码的电脑中MySQL安装目录中/data/mysql的全部内容(要先停止MySQL服务)
3,Copy新装的电脑上MySQL安装目录中/data/mysql的全部内容 to 刚刚删除的目录中
4,启动MySQL服务
bitsCN.com
以上就是最好用的mysql密码忘记的解决方法_MySQL的内容,更多相关内容请关注PHP中文网(www.php.cn)!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Troubleshooting and solutions to the company's security software that causes some applications to not function properly. Many companies will deploy security software in order to ensure internal network security. ...

MySQL and phpMyAdmin are powerful database management tools. 1) MySQL is used to create databases and tables, and to execute DML and SQL queries. 2) phpMyAdmin provides an intuitive interface for database management, table structure management, data operations and user permission management.

Safely handle functions and regular expressions in JSON In front-end development, JavaScript is often required...

How to solve the problem of printing spaces in IDEA console logs? When using IDEA for development, many developers may encounter a problem: the console printed...

In SpringBoot, use Redis to cache OAuth2Authorization object. In SpringBoot application, use SpringSecurityOAuth2AuthorizationServer...

In processing next-auth generated JWT...

Discussing the reasons and solutions for inconsistent results of JSONObject and Map serialization. When serializing data, we often use different data structures to...

In IntelliJ...
