mysql登录密码忘了怎么办?修改mysql登录密码的方法

Infocode蓝畅 互联网开发 535

修改mysql登录密码的方法

前提:以root 权限登录mysql,修改普通用户

步骤:

1、打开cmd命令窗口,执行命令mysql -u root -p指定 root 用户登录 MySQL,输入后按回车键输入密码。
1.png

2、使用 SET PASSWORD 修改密码

命令格式为 :

set password for username@localhost = password(newpwd);

其中 username 为要修改密码的用户名,newpwd 为要修改的新密码。

如图所示:

接下来输入quit;命令退出 MySQL 重新登录,就可以使用新密码“root”登录!




请在浏览器中启用JavaScript来完成此表单。
请输入姓名或昵称
如果您有任何疑问、需要更多信息或希望与我们建立合作请留言
=
( function() { const style = document.createElement( 'style' ); style.appendChild( document.createTextNode( '#wpforms-17950-field_1-container { position: absolute !important; overflow: hidden !important; display: inline !important; height: 1px !important; width: 1px !important; z-index: -1000 !important; padding: 0 !important; } #wpforms-17950-field_1-container input { visibility: hidden; } #wpforms-conversational-form-page #wpforms-17950-field_1-container label { counter-increment: none; }' ) ); document.head.appendChild( style ); document.currentScript?.remove(); } )();
加载

回复

我来回复
  • 暂无回复内容