Home >Database >Mysql Tutorial >MySQL 更改root密码

MySQL 更改root密码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:24:50812browse

环境 RedHat Linux 9 + VWWare 8.0 + SSH 3.2.9 + Putty 0.62 + MySQL 3.2 问题 MySQL 更改root密码 解决 mysqladmin -u USER -p

环境

RedHat Linux 9 + VWWare 8.0 + SSH 3.2.9 + Putty 0.62 + MySQL 3.2

问题

MySQL 更改root密码

解决

mysqladmin -u USER -p password PASSWORD

USER为用户名,PASSWORD为新密码

该命令之后会提示输入原密码,,输入正确后即可修改。

例如,设置root用户的密码为123456,则mysqladmin -u root -p password 123456

输入这个命令后,需要输入root的原密码,然后root的密码将改为PASSWORD。

把命令里的root改为你的用户名,你就可以改你自己的密码了。

当然如果你的mysqladmin连接不上mysqlserver,或者你没有办法执行mysqladmin,那么这种方法就是无效的,而且mysqladmin无法把密码清空。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn