Home > Database > Mysql Tutorial > mysql root用户的密码修改和消除_MySQL

mysql root用户的密码修改和消除_MySQL

WBOY
Release: 2016-06-01 13:19:21
Original
1234 people have browsed it

bitsCN.com

一、密码的修改:使用mysqladmin命令

1、例如你的 root用户现在没有密码,你希望的密码修改为abc,那么命令是:mysqladmin -u root password abc

2、如果你的root现在有密码了,那么修改密码为abc的命令是:mysqladmin -u root -p password youyou
注意,命令回车后会问你旧密码,输入旧密码之后命令完成,密码修改成功。
二、密码的消除

1、以root登录:mysql -u root -p

2、mysql>use mysql;

3、mysql>update user set password='' where user='root';
重新启动下mysql服务就可以啦

bitsCN.com
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template