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

修改MySQL的默认密码

WBOY
WBOYOriginal
2016-06-07 16:04:311004browse

对于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
Previous article:MySQL5的异常处理Next article:MySQL5新特点(数据字典)