M
M
Meowt2015-03-22 16:29:46
MySQL
Meowt, 2015-03-22 16:29:46

How to connect to mysql via localhost?

Good day.
In general, I updated the muscle from 5.5 to 5.6 and decided to check for errors in the tables after the update using mysqlcheck, but how surprised I was when I saw the message "Access denied for user 'root'@'::1'" . I went to Google - I realized that the reason was ipv6, turned it off and then another error "Access denied for user 'root'@'127.0.0.1'" came up.
Paradox:
localhost=127.0.0.1
[email protected] exists and the password to it
[email protected]'127.0.0.1 does not exist.
How to be? Create [email protected]'127.0.0.1 or login from localhost somehow?
Thanks in advance for your replies.
PS The quotation mark between @ and 127 is set on purpose, without it 127 - selection of the user 127.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vlad Zhivotnev, 2015-03-22
@Meowt

localhost in mysql terminology is _always_ a socket on disk.
127.0.0.1 - locally running on port 3306 (unless otherwise specified) mysql server.
That is, for the muscle "127.0.0.1" != "localhost" always, regardless of the settings.
And then look at the grants of the root user.

S
SagePtr, 2015-03-22
@SagePtr

Are there any entries in the hosts file other than 127.0.0.1 localhost ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question