|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
>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. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
"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. |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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. |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
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 |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
>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. |
|
![]() |
| Outils de la discussion | |
|
|