Pico's world

RSS

Posts tagged with "mysql"

MySQL Creating user rookie mistakes

I created a user ‘monty’ in a MySQL DB using the following command

CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';

Then tried to connect to it from the local computer:

mysql -u monty -password=some_pass

It never worked… I spent an hour trying to figure it out, the answer was on the page I was reading.

It is necessary to have both accounts for monty to be able to connect from anywhere as monty. Without thelocalhost account, the anonymous-user account for localhost that is created by mysql_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 specific Host column value than the'monty'@'%' account and thus comes earlier in the user table sort order. (user table sorting is discussed inSection 5.4.4, “Access Control, Stage 1: Connection Verification”.)

Not happy with myself right now =/

MySQL tutorial

I find this tutorial useful when I need to connect to MySQL and do some administrative work.