After setting password with this command:
mysqladmin.exe --user=root password <my_password>
I see 3 rows in user table for "root" user: http://i.stack.imgur.com/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?
The default user for MySQL is root and by default it has no password.
Setting the strong passwords for your root user is very important from the security view so that the sensitive data stored in your MySQL database remains protected.
In the mysql client, tell the server to reload the grant tables so that account-management statements work: mysql> FLUSH PRIVILEGES; Then change the 'root'@'localhost' account password. Replace the password with the password that you want to use.
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.
::1 is the IPV6 IP address of 127.0.0.1 (which is IPV4), which is also localhost.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With