手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Fedora 14下 MySQL 更改密码

[日期:2011-08-23] 来源:Linux社区  作者:dysj4099 [字体:大 中 小]

不知为什么,Fedora 14下用yum安装MySQL后配置挺麻烦,现将更改密码的方法记录一下。

报错问题:

[root@www.linuxidc.com mysql]# mysqladmin -u root password 123456
mysqladmin: Can't turn off logging; error: 'Access denied; you need the SUPER privilege for this operation'

是权限的问题么?不解

解决方法:

1. 修改文件/etc/my.cnf,在[mysqld]段中加入skip-grant-tables,就是在启动打开mysql时跳过权限验证,保存退出。

2.重启mysql服务[root@www.linuxidc.com mysql]# service mysqld restart

3.登录mysql修改密码

  1. [root@www.linuxidc.com mysql]# mysql  
  2. Welcome to the MySQL monitor.  Commands end with ; or \g.  
  3. Your MySQL connection id is 2  
  4. Server version: 5.1.56 Source distribution  
  5.   
  6. Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.  
  7. This software comes with ABSOLUTELY NO WARRANTY. This is free software,  
  8. and you are welcome to modify and redistribute it under the GPL v2 license  
  9.   
  10. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  11.   
  12. mysql> USE mysql;  
  13. Reading table information for completion of table and column names  
  14. You can turn off this feature to get a quicker startup with -A  
  15.   
  16. Database changed  
  17. mysql> UPDATE user SET Password = password('passwd') WHERE User = 'root';  
  18. Query OK, 4 rows affected (0.00 sec)  
  19. Rows matched: 4  Changed: 4  Warnings: 0  
  20.   
  21. mysql> flush privileges;  
  22. Query OK, 0 rows affected (0.00 sec)  
  23.   
  24. mysql> quit  
4.配置文件/etc/my.cnf改回,重启服务即可

Good luck

linux
相关资讯       Fedora教程MySQL教程 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款