创建用户后登陆失败的原因是存在匿名用户: root@controller:~# mysql -h localhost -uaa -ppassword ERROR 1045 (28000): Access denied for user 'aa'@'localhost' (using password: YES) 解决方法: 增加普通用户后,登陆root账号,执行: mysql> use mysql mysql> delete from user where user=''; mysql>
一.创建用户 mysql -u root -p 1.mysql->create user 'test'@'localhost' identified by '123'; 2.mysql->create user 'test'@'192.168.7.22' identified by '123'; 3.mysql->create user 'test'@'%' identified by '123'; 注意:此处的"localhost",是指该用户只能在本地登录,不能在