MySQL root@localhost, [email protected] and root@::1 have different passwords - is it normal?
Asked Answered
O

2

7

After setting password with this command:

mysqladmin.exe --user=root password <my_password>

I see 3 rows in user table for "root" user: enter image description here https://i.sstatic.net/Y4Rkd.jpg and root@localhost has password, while [email protected] and root@::1 do not have password.

Does it mean that I need to set password 3 times for each of these rows? i.e.:

mysqladmin.exe --user=root host=localhost password <my_password>
mysqladmin.exe --user=root host=127.0.0.1 password <my_password>
mysqladmin.exe --user=root host=::1 password <my_password>

Is this normal?

Octodecimo answered 25/5, 2016 at 6:4 Comment(0)
S
5

Yes, this is different accounts. And yes, every account can have own password. You can check details about account names here.
If you don't set host with mysql utilities (such as mysqladmin), by default it will connect to localhost. So, you was really connected under user root@localhost and changed password for this user only. For two other root users you must change password explicitly.

Sholley answered 25/5, 2016 at 7:31 Comment(0)
I
3

::1 is the IPV6 IP address of 127.0.0.1 (which is IPV4), which is also localhost.

Ignore answered 25/5, 2016 at 6:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.