Home  >  Article  >  Database  >  修改MySQL的默认密码的方法

修改MySQL的默认密码的方法

WBOY
WBOYOriginal
2016-06-07 16:17:45936browse

对于windows平台来说安装完MySQL后,系统就已经默认生成了许可表和账户,你不需要像在Unix平台上那样执行 mysql_install_db脚本来生成帐户和相应权限许可表。但是如果不是用MSI格式来安装MySQL的话,就需要在安装完以后,手动给 root帐户添加新密码,因为默

  对于windows平台来说安装完MySQL后,系统就已经默认生成了许可表和账户,你不需要像在Unix平台上那样执行 mysql_install_db脚本来生成帐户和相应权限许可表。但是如果不是用MSI格式来安装MySQL的话,,就需要在安装完以后,手动给 root帐户添加新密码,因为默认情况下的root没有开启密码保护功能,如果不重新赋予root帐户密码,那么许多非本机的连接将 无法成功。具体更新密码步骤如下:

  c:>mysql -u root

  mysql>set password for 'root'@'localhost'=password('newpasswd');

  mysql>set password for 'root'@'%'=password('newpasswd'); //本条可选

  通过以上设置,root的密码将变为newpasswd这样就完成了根用户root密码的设置工作。

        :更多精彩教程请关注三联图文教程 频道,

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