PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Are these 3 hosts not the same thing?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Are these 3 hosts not the same thing?

Réponse
 
LinkBack Outils de la discussion
Vieux 13/10/2007, 23h24   #1
Mike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Are these 3 hosts not the same thing?

I have just taken over a server and have the following config


User Host Password GlobalPrivilages Grant

root 127.0.0.1 No ALL PRIVILEGES Yes
root localhost Yes ALL PRIVILEGES Yes
root mydomainname.com Yes ALL PRIVILEGES Yes


Surely these 3 hosts are the same thing?.
I don't understand why the person who set this server up has 3 entries here.
I always thought host was always Localhost or Any.
Can anyone shed any light on why there are 3 entries?.

Thanks
Mike

PS. Additionally - Is it ok/normal to just delete the Test and Mysql
database?





  Réponse avec citation
Vieux 13/10/2007, 23h44   #2
Gordon Burditt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Are these 3 hosts not the same thing?

>I have just taken over a server and have the following config
>
>
>User Host Password GlobalPrivilages Grant
>
>root 127.0.0.1 No ALL PRIVILEGES Yes
>root localhost Yes ALL PRIVILEGES Yes
>root mydomainname.com Yes ALL PRIVILEGES Yes


A host name of 'localhost' means "use the local socket".
(mysql -h localhost)

A host name of 'Localhost' or 'lOcAlHoSt' means "use TCP/IP using
whatever IP address 'Localhost' resolves to, hopefully 127.0.0.1" .
Equivalent to using 127.0.0.1 directly.
(mysql -h Localhost)

A host name of mydomainname.com means "use TCP/IP using whatever IP
address 'mydomainname.com' resolves to, hopefully *NOT* 127.0.0.1" .

>Surely these 3 hosts are the same thing?.


No. They may refer to the same physical host, but not the same IP address.
A multi-homed host will have one (or more) IP address for each interface.

>I don't understand why the person who set this server up has 3 entries here.
>I always thought host was always Localhost or Any.
>Can anyone shed any light on why there are 3 entries?.
>
>Thanks
>Mike
>
>PS. Additionally - Is it ok/normal to just delete the Test and Mysql
>database?


It is OK to delete the 'test' database, although I have run across scripts
that try to use it.

Deleting the 'mysql' database is somewhat suicidal as this database holds
the grant permissions.

  Réponse avec citation
Vieux 14/10/2007, 00h34   #3
Mike
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Are these 3 hosts not the same thing?


"Gordon Burditt" <gordonb.t0tsu@burditt.org> wrote in message
news:13h2f1gncbbfo58@corp.supernews.com...
> >I have just taken over a server and have the following config
>>
>>
>>User Host Password GlobalPrivilages Grant
>>
>>root 127.0.0.1 No ALL PRIVILEGES Yes
>>root localhost Yes ALL PRIVILEGES Yes
>>root mydomainname.com Yes ALL PRIVILEGES Yes

>
> A host name of 'localhost' means "use the local socket".
> (mysql -h localhost)
>
> A host name of 'Localhost' or 'lOcAlHoSt' means "use TCP/IP using
> whatever IP address 'Localhost' resolves to, hopefully 127.0.0.1" .
> Equivalent to using 127.0.0.1 directly.
> (mysql -h Localhost)
>
> A host name of mydomainname.com means "use TCP/IP using whatever IP
> address 'mydomainname.com' resolves to, hopefully *NOT* 127.0.0.1" .
>
>>Surely these 3 hosts are the same thing?.

>
> No. They may refer to the same physical host, but not the same IP
> address.
> A multi-homed host will have one (or more) IP address for each interface.



The server has only 1 IP address.
I see now why a reason for the mydomainname.com entry (thank you) but im
not sure why the localhost and 127.0.0.1 are both in their or why they don't
conflict with each other since as you can see above one has a password as
Yes the other No.


  Réponse avec citation
Vieux 14/10/2007, 00h42   #4
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Are these 3 hosts not the same thing?

On Sun, 14 Oct 2007 00:34:46 +0200, Mike <me@privacy.net> wrote:

>
> "Gordon Burditt" <gordonb.t0tsu@burditt.org> wrote in message
> news:13h2f1gncbbfo58@corp.supernews.com...
>> >I have just taken over a server and have the following config
>>>
>>>
>>> User Host Password GlobalPrivilages Grant
>>>
>>> root 127.0.0.1 No ALL PRIVILEGES Yes
>>> root localhost Yes ALL PRIVILEGES Yes
>>> root mydomainname.com Yes ALL PRIVILEGES Yes

>>
>> A host name of 'localhost' means "use the local socket".
>> (mysql -h localhost)
>>
>> A host name of 'Localhost' or 'lOcAlHoSt' means "use TCP/IP using
>> whatever IP address 'Localhost' resolves to, hopefully 127.0.0.1" .
>> Equivalent to using 127.0.0.1 directly.
>> (mysql -h Localhost)
>>
>> A host name of mydomainname.com means "use TCP/IP using whatever IP
>> address 'mydomainname.com' resolves to, hopefully *NOT* 127.0.0.1" .
>>
>>> Surely these 3 hosts are the same thing?.

>>
>> No. They may refer to the same physical host, but not the same IP
>> address.
>> A multi-homed host will have one (or more) IP address for each
>> interface.

>
>
> The server has only 1 IP address.
> I see now why a reason for the mydomainname.com entry (thank you) but im
> not sure why the localhost and 127.0.0.1 are both in their or why they
> don't
> conflict with each other since as you can see above one has a password
> as
> Yes the other No.


127.0.0.1 is certainly the same machine.
localhost _should_ be the same machine, but is not always configured that
way AFAIK. I have run into troubles relying it on other peoples weird
configurations before :P.
--
Rik Wasmus
  Réponse avec citation
Vieux 14/10/2007, 19h25   #5
Paul Lautman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Are these 3 hosts not the same thing?

Mike wrote:
> "Gordon Burditt" <gordonb.t0tsu@burditt.org> wrote in message
> news:13h2f1gncbbfo58@corp.supernews.com...
>>> I have just taken over a server and have the following config
>>>
>>>
>>> User Host Password GlobalPrivilages Grant
>>>
>>> root 127.0.0.1 No ALL PRIVILEGES Yes
>>> root localhost Yes ALL PRIVILEGES Yes
>>> root mydomainname.com Yes ALL PRIVILEGES Yes

>>
>> A host name of 'localhost' means "use the local socket".
>> (mysql -h localhost)
>>
>> A host name of 'Localhost' or 'lOcAlHoSt' means "use TCP/IP using
>> whatever IP address 'Localhost' resolves to, hopefully 127.0.0.1" .
>> Equivalent to using 127.0.0.1 directly.
>> (mysql -h Localhost)
>>
>> A host name of mydomainname.com means "use TCP/IP using whatever IP
>> address 'mydomainname.com' resolves to, hopefully *NOT* 127.0.0.1" .
>>
>>> Surely these 3 hosts are the same thing?.

>>
>> No. They may refer to the same physical host, but not the same IP
>> address.
>> A multi-homed host will have one (or more) IP address for each
>> interface.

>
>
> The server has only 1 IP address.
> I see now why a reason for the mydomainname.com entry (thank you) but im
> not sure why the localhost and 127.0.0.1 are both in their or
> why they don't conflict with each other since as you can see above
> one has a password as Yes the other No.


Gordon explained why localhost and 127.0.0.1 are both in there (note there
not their).

Here it is again:
A host name of 'localhost' means "use the local socket".
(mysql -h localhost)

A host name of 'Localhost' or 'lOcAlHoSt' means "use TCP/IP using
whatever IP address 'Localhost' resolves to, hopefully 127.0.0.1" .
Equivalent to using 127.0.0.1 directly.


  Réponse avec citation
Vieux 15/10/2007, 01h47   #6
Peter H. Coffin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Are these 3 hosts not the same thing?

On Sat, 13 Oct 2007 23:34:46 +0100, Mike wrote:
>
> "Gordon Burditt" <gordonb.t0tsu@burditt.org> wrote in message
> news:13h2f1gncbbfo58@corp.supernews.com...
>> >I have just taken over a server and have the following config
>>>
>>>
>>>User Host Password GlobalPrivilages Grant
>>>
>>>root 127.0.0.1 No ALL PRIVILEGES Yes
>>>root localhost Yes ALL PRIVILEGES Yes
>>>root mydomainname.com Yes ALL PRIVILEGES Yes

>>
>> A host name of 'localhost' means "use the local socket".
>> (mysql -h localhost)
>>
>> A host name of 'Localhost' or 'lOcAlHoSt' means "use TCP/IP using
>> whatever IP address 'Localhost' resolves to, hopefully 127.0.0.1" .
>> Equivalent to using 127.0.0.1 directly.
>> (mysql -h Localhost)
>>
>> A host name of mydomainname.com means "use TCP/IP using whatever IP
>> address 'mydomainname.com' resolves to, hopefully *NOT* 127.0.0.1" .
>>
>>>Surely these 3 hosts are the same thing?.

>>
>> No. They may refer to the same physical host, but not the same IP
>> address.
>> A multi-homed host will have one (or more) IP address for each interface.

>
>
> The server has only 1 IP address.


I doubt it. Unless that server has no network connectivity outside
itself at all.

> I see now why a reason for the mydomainname.com entry (thank you) but
> im not sure why the localhost and 127.0.0.1 are both in their or why
> they don't conflict with each other since as you can see above one
> has a password as Yes the other No.


They are different: root is allowed to log in without a password via
the network socket connection from this machine only, but requires a
password for ANY network connection outside of this machine, or locally
via the unix socket. It would be an understandable configuration if
127.0.0.1 and localhost were reverse, though insufficiently paranoid
for my taste.

--
46. If an advisor says to me "My liege, he is but one man. What can one man
possibly do?", I will reply "This." and kill the advisor.
--Peter Anspach's list of things to do as an Evil Overlord
  Réponse avec citation
Vieux 15/10/2007, 05h51   #7
Gordon Burditt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Are these 3 hosts not the same thing?

>127.0.0.1 is certainly the same machine.
>localhost _should_ be the same machine, but is not always configured that
>way AFAIK. I have run into troubles relying it on other peoples weird
>configurations before :P.


MySQL uses 'localhost' to indicate that it should use the local
UNIX-domain socket, *REGARDLESS* of how someone manages to configure
DNS or the hosts file to point elsewhere. On the other hand, it
seems to use a case-sensitive comparison, so 'Localhost' and
'localHoSt' are subject to oddities of configuration of the hosts
file and DNS and don't use the UNIX-domain socket.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h06.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,24226 seconds with 15 queries