安装mysql,更改密码无效

转自:http://blog.sina.com.cn/s/blog_4002e0d20100mw2v.html

现象: 更改密码无效,重启 mysql服务之后  还是无效
日志提示:
101101 18:31:57 [Warning] Found invalid password for user: 'root@localhost'; Ignoring user
101101 18:31:57 [Warning] Found invalid password for user: '[email protected]'; Ignoring user
并且   show databases 看不到 mysql库

解决办法:

1。停掉mysql服务 
2.删掉  mysql数据库目录里的 mysql目录
3.执行  msyql_install_db    chown -R mysql:mysql /usr/local/mysql/var
4.启动服务,进入msyql
5.执行句子
delete from user where user='';

delete from user where host='localhost.localdomain';

update user set password=password('111111') where user='root';

update user set host='%' where user='root';

------------------ok-----------------------------------------------------
 

'./mysql-bin.index' not found (Errcode: 13) 的解决方法



提示./mysql-bin.index无法找到(由于mysql开启了bin日志功能),到数据库根目录查看该文件是存在的,可能是文件权限的问题,查看了数据库根目录的权限是700,所有者和用户组都是root,应该是mysql
解决方法:
chgrp -R mysql ./var && chown -R mysql ./var  (这里数据库根目录为var)
重新启动mysql  [OK]
 

你可能感兴趣的:(mysql,password,Invalid,databases,更改密码)