Page 1 of 1

Passwords for root (localhost and 127.0.0.1)

PostPosted: 28. November 2008 15:24
by Lk@zz
Hi

I have XAMPP 1.6.8. After installation, in MySQL database I have two root users (for host: localhost and 127.0.0.1). I set password for MySQL by
http://localhost/security/xamppsecurity.php After this, user root for localhost has password, but user root for 127.0.0.1 still hasn't got password (I try change it by: http://127.0.0.1/security/xamppsecurity.php, but it doesn't work). I'd like to ask: why one user root has password and second root doesn't have? Does XAMPP use only localhost and doesn't use 127.0.0.1 (so why there is host for 127.0.0.1)?

Thanks awfully for help.
Regards

PostPosted: 30. November 2008 05:40
by Sharley
localhost is the same as 127.0.0.1 - the local loop back address, only accessible on your own PC not from anywhere else.

So the same super user root and it's password you set in the security pages is used for both.

So if you go to:
http://localhost/phpmyadmin
You are asked for
Username root
Password rootpassword

If you go to
http://127.0.0.1/phpmyadmin
You are asked for
Username root
Password rootpassword

In my XAMPP installation I do have a host 127.0.0.1 with root and No password but I just followed what I typed above and could not access phpMyAdmin from 127.0.0.1 without I use the root user and it's password - so even though the MySQL database and the phpMyAdmin Privileges both say No password under host 127.0.0.1 for root user, you simply can't access with http://127.0.0.1/phpmyadmin without using root with a rootpassword if you have set one for localhost (same as 127.0.0.1) in the security pages.