Using this command
GRANT ALL PRIVILEGES ON *.* to \'brian\'@\'%\' identified by \'password\';
I try to login with:
mysql -
The mysql docs have this to say: (from http://dev.mysql.com/doc/refman/5.1/en/adding-users.html):
Two of the accounts have a user name of
monty
and a password ofsome_pass
. Both accounts are superuser accounts with full privileges to do anything. The'monty'@'localhost'
account can be used only when connecting from the local host. The'monty'@'%'
account uses the'%'
wildcard for the host part, so it can be used to connect from any host.It is necessary to have both accounts for
monty
to be able to connect from anywhere asmonty
. Without the localhost account, the anonymous-user account for localhost that is created bymysql_install_db
would take precedence when monty connects from the local host. As a result,monty
would be treated as an anonymous user. The reason for this is that the anonymous-user account has a more specificHost
column value than the'monty'@'%'
account and thus comes earlier in the user table sort order.
With this in mind I would recommend you create a 'brian'@'localhost'
user with the same privileges.