设为首页 加入收藏

TOP

更改root密码和恢复MySQL root用户
2011-06-12 21:41:40 来源: 作者: 【 】 浏览:497次 评论:0

更改root密码和恢复mysql教程 root用户
我不小心删除了mysql的root帐号。我该怎么办?"和"我失去了我的根密码?这种问题经碰到,那么你碰这类问题时是备份数据,重新安装mysql和恢复所有数据库教程文件?还是怎么办,我们现在为你找到一个更好的办法。

1、停止mysql ,
2、服务器权限
c:www.111cn.netbinmysqld-nt.exe --skip-grant-tables
    where c:www.111cn.net is mysql'instalation directory.
    如果是linux就如下执行命令
    /usr/local/mysql/bin/mysqld_safe --skip-grant-tables --user=root --skip-networking
3、连接到服务器使用exsisting帐户(root或某些otherif root帐户被删除)。
     c:www.111cn.netbinmysql.exe -u user
     or
     /usr/local/mysql/bin/mysql -u user
    
4、更改mysql 查询密码
 update mysql.user set password=password('newpwd') where user='root';
    or recreating user:
        create user root identified by password 'newpwd';
        grant all privileges on * . * to 'root'@ 'localhost' identified by 'newpwd' with grant option max_queries_per_hour 0 max_connections_per_hour 0 max_updates_per_hour 0 max_user_connections 0 ;

5、刷新权限
 flush privileges;

6、重新启动服务器
ok mysql root密码就被你找回来了哈。

更改root密码和恢复MySQL root用户更多相关文章

您看到此篇文章时的感受是:
Tags: 责任编辑:administrator
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到QQ空间
分享到: 
上一篇mysql alter 修改字名 表名 结构 .. 下一篇mysql存储过程查看,修改,删除,..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

相关栏目

最新文章

图片主题

热门文章

推荐文章

相关文章

广告位