You get the error while trying to login from 127.0.0.1 because you have not created an account for 'newuser' that is allowed access MySQL from an ip address of 127.0.0.1.
See your 'root' accounts for example.
There are 4 accounts for 'root' i.e. root@localhost
, root@127.0.0.1
, root@::1
and root@ns3367936
.
A MySQL account requires the Username and a host. You only have 'newuser@localhost` and you need newuser@127.0.0.1 as well, and maybe root@::1 also if you have IPV6 running
Of course you coudl also edit the existing 'newuser' account and wilcard the host so that that user can login from any host.
Host in this case I always find is a misleading name, in fact it means the location that the user is trying to login from. So if you wanted to allow the 'newuser' account to login from a remote location like home, you could also add a newuser@11.22.33.44
account, assuming your home IP address was 11.22.33.44