登录mysql时总是提示:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
后来进入用 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables --user=root进入修改了密码,提示成功,但是还是进不了,提示一样的错误。
有一点很奇怪,我用--skip-grant-tables进去查看了一下用户列表是空的。
mysql> select user from mysql.user;
Empty set (0.00 sec)
怎么解决啊?

解决方案 »

  1.   

    mysqld -skip-grant-tables
    /etc/init.d/mysql start –mysqld –skip-grant-tables
      

  2.   

    1、使用—skip-grant-tables选项来启动MySQL服务>mysqld –skip-grant-tables #/etc/init.d/mysql start –mysqld –skip-grant-tables 2、登录root,设置新密码mysql –u rootupdate mysql.user set password=password(“new_password”) where user=’root’and host=’localhost’; 3、加载权限表fush privileges;
      

  3.   

    进入以后,加用户
    grant all on *.* to root@'localhost' identified by 'yourpassword';
    grant all on *.* to root@'%' identified by 'yourpassword';
      

  4.   

    1、使用—skip-grant-tables选项来启动MySQL服务>mysqld –skip-grant-tables2.创建root并赋予权限
    grant all on *.* to root@'localhost' identified by 'password';
    grant all on *.* to root@'%' identified by 'password';
      

  5.   

    使用—skip-grant-tables登录之后,创建用户提示错误啊,这个我试过了,提示在—skip-grant-tables无法创建用户。