ERROR 1045 (28000): Access denied for user 'ljcc'@'localhost' (using password: YES) 步骤 创建了mysql的用户 insert mysql.user(Host,User,Password) values('%', 'django',password('django')); 接着赋予用户权限 grant all privileges on djtest.* to 'django'@'%' identified by 'django'; 更新数据 flush privileges 然后登陆报错 ERROR 1045 (28000): Access denied for user 'ljcc'@'localhost' (using password: YES) 匿名用户惹的货 查看用户信息 select user,host from mysql.user; ← 查看用户信息 删除匿名用户: delete from mysql.user where user=''; FLUSH PRIVILEGES; mysql -udjango -pdjango 登陆成功