Why is Host option Failing?

Why is Host option Failing?

am 05.07.2010 00:38:29 von Michael Satterwhite

I've recently reloaded my box (PCLinuxOS). The machine name on the network is
photon. I've set this in the hosts table, in hostname, and on the network. in
my.cnf I have the following 2 lines:

bind-address = photon
bind-address = localhost

The "skip-networking" directive is commented out. If I execute

mysql -h photon

I get: ERROR 2003 (HY000): Can't connect to MySQL server on 'photon' (111).

mysql -h localhost

Works fine. Would someone be so kind as to let me know what I'm missing?
Thanks in advance
---Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Why is Host option Failing?

am 05.07.2010 01:36:00 von Michael Dykman

What user are you at the time you are running these tests. Would I be
correct in guessing 'root'?

The reason localhost works is because, in some distros, root is
enabled localhost with no password .. which is dangerous enough..
granting root@'%" would be an invitation to disaster..

From that same command line, what do you get for
$ dig photon

You likely want to make a grant suitable rfor that network address for
the user you are trying to use.

- michael dykman

On Sun, Jul 4, 2010 at 6:38 PM, Michael Satterwhite w=
rote:
> I've recently reloaded my box (PCLinuxOS). The machine name on the networ=
k is
> photon. I've set this in the hosts table, in hostname, and on the network=
.. in
> my.cnf I have the following 2 lines:
>
> bind-address =A0 =A0 =A0 =A0 =A0  = photon
> bind-address =A0 =A0 =A0 =A0 =A0  = localhost
>
> The "skip-networking" directive is commented out. If I execute
>
> =A0 =A0 =A0 =A0mysql -h photon
>
> I get: ERROR 2003 (HY000): Can't connect to MySQL server on 'photon' (111=
).
>
> mysql -h localhost
>
> Works fine. Would someone be so kind as to let me know what I'm missing?
> Thanks in advance
> ---Michael
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: =A0 =A0http://lists.mysql.com/mysql?unsub=3Dmdykman@gmail=
..com
>
>



--=20
- michael dykman
- mdykman@gmail.com

May the Source be with you.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

Re: Why is Host option Failing?

am 05.07.2010 04:35:55 von Michael Satterwhite

On Sunday, July 04, 2010 06:36:00 pm you wrote:
> What user are you at the time you are running these tests. Would I be
> correct in guessing 'root'?
>
> The reason localhost works is because, in some distros, root is
> enabled localhost with no password .. which is dangerous enough..
> granting root@'%" would be an invitation to disaster..
>
> From that same command line, what do you get for
> $ dig photon
>
> You likely want to make a grant suitable rfor that network address for
> the user you are trying to use.
>
> - michael dykman

This sounded good, but....

"dig photon" returns "command not found"

I logged onto the server as root and issued the command:

grant all privileges on *.* to 'michael'@'%' identified by ????;
(??? is the password, in quotes, of course). It responded
Query OK, 0 rows affected (0.00 sec)

I still can't connect via
mysql -h photon -u michael -p??????

Still
ERROR 2003 (HY000): Can't connect to MySQL server on 'photon' (111)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Why is Host option Failing?

am 05.07.2010 17:04:22 von Michael Satterwhite

On Monday, July 05, 2010 08:26:03 am you wrote:
> Hi,
>
> dig should be in /usr/bin but its possible it isn't installed
> I'm not sure about PcLinuxOS but it's in the dnsutils package on
> debian/Ubuntu.

As you said earlier, it's not necessary to use dig to check the ip address.
Ping does the job.
>
> Also, after you change DB/User permissions with GRANT statements it's often
> necessary to do a 'FLUSH PRIVILEGES;'
This I didn't know.. I just tried it, though, and it makes no difference.

>
> It's also entirely possible that Photon resolves to 127.0.0.1 in which case
> you will need GRANT for 'michael'@'localhost'
> Is the name pho

[michael@photon ~]$ ping photon
PING photon (192.168.1.20) 56(84) bytes of data.
64 bytes from photon (192.168.1.20): icmp_seq=1 ttl=64 time=0.047 ms
64 bytes from photon (192.168.1.20): icmp_seq=2 ttl=64 time=0.045 ms


> ton listed in /etc/hosts ?
>
> Hope thats of some use
> mc
>
> On 5 July 2010 03:35, Michael Satterwhite wrote:
> > On Sunday, July 04, 2010 06:36:00 pm you wrote:
> > > What user are you at the time you are running these tests. Would I be
> > > correct in guessing 'root'?
> > >
> > > The reason localhost works is because, in some distros, root is
> > > enabled localhost with no password .. which is dangerous enough..
> > > granting root@'%" would be an invitation to disaster..
> > >
> > > From that same command line, what do you get for
> > > $ dig photon
> > >
> > > You likely want to make a grant suitable rfor that network address for
> > > the user you are trying to use.
> > >
> > > - michael dykman
> >
> > This sounded good, but....
> >
> > "dig photon" returns "command not found"
> >
> > I logged onto the server as root and issued the command:
> >
> > grant all privileges on *.* to 'michael'@'%' identified by ????;
> > (??? is the password, in quotes, of course). It responded
> >
> > Query OK, 0 rows affected (0.00 sec)
> >
> > I still can't connect via
> >
> > mysql -h photon -u michael -p??????
> >
> > Still
> >
> > ERROR 2003 (HY000): Can't connect to MySQL server on 'photon'
> > (111)
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe: http://lists.mysql.com/mysql?unsub=clarkem7@gmail.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Why is Host option Failing?

am 05.07.2010 17:46:48 von Bob Cole

--Apple-Mail-1--610101718
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=us-ascii


On Jul 5, 2010, at 10:04 AM, Michael Satterwhite wrote:
>> [...snip...]
>> On 5 July 2010 03:35, Michael Satterwhite =
wrote:
>>> On Sunday, July 04, 2010 06:36:00 pm you wrote:
>>> [...snip...]
>>> I still can't connect via
>>> mysql -h photon -u michael -p??????

On my home computer I entered the following
(note there is no space between the -p and the password):
$ mysql -h www.my_abc_xyz.com -u myUserNm -pMyPasswrd

The remote computer let me into mysql and I typed:
mysql> use mysql
mysql> select host, user, Password, Select_priv from user;
=
+------------------+----------+----------------------------- --------------=
+-------------+
| host | user | Password =
| Select_priv |
=
+------------------+----------+----------------------------- --------------=
+-------------+
| localhost | myUserNm | *ABC8C800D9A264876A32F5175DE21C1A0B89XYZ =
| Y |
| % | myUserNm | *ABC8C800D9A264876A32F5175DE21C1A0B89XYZ =
| Y |
=
+------------------+----------+----------------------------- --------------=
+-------------+

Your results should be similar.
HTH,
Bob


--Apple-Mail-1--610101718--

Re: Why is Host option Failing?

am 05.07.2010 18:10:21 von Michael Satterwhite

On Monday, July 05, 2010 10:46:48 am Bob Cole wrote:

>
> The remote computer let me into mysql and I typed:
> mysql> use mysql
> mysql> select host, user, Password, Select_priv from user;
> +------------------+----------+----------------------------- --------------+
> -------------+
>
> | host | user | Password |
> | Select_priv |
>
> +------------------+----------+----------------------------- --------------+
> -------------+
>
> | localhost | myUserNm | *ABC8C800D9A264876A32F5175DE21C1A0B89XYZ |
> | Y | % | myUserNm |
> | *ABC8C800D9A264876A32F5175DE21C1A0B89XYZ | Y |
>
> +------------------+----------+----------------------------- --------------+
> -------------+
>
> Your results should be similar.
> HTH,
> Bob

Bob, I thought you'd identified the problem, but I don't think it is. Here's my
output
+-----------+------------------+---------------------------- ---------------+
| host | user | password |
+-----------+------------------+---------------------------- ---------------+
| localhost | root | *135A6626293E0699534358EE0AB1230BF69067A5 |
| PHOTON | root | *135A6626293E0699534358EE0AB1230BF69067A5 |
| 127.0.0.1 | root | *135A6626293E0699534358EE0AB1230BF69067A5 |
| localhost | debian-sys-maint | *2BA4FF2E2728588CB18B3A06924A8C37B5467F11 |
| localhost | michael | *101CC8AAEAEBFDC7571307AD2B51F34D95B80572 |
| localhost | webcalendar | *135A6626293E0699534358EE0AB1230BF69067A5 |
| photon | michael | *101CC8AAEAEBFDC7571307AD2B51F34D95B80572 |
| % | michael | *101CC8AAEAEBFDC7571307AD2B51F34D95B80572 |
+-----------+------------------+---------------------------- ---------------+

I'm sure you know more than I do, but it looks good to me.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Why is Host option Failing?

am 05.07.2010 20:17:57 von burhan.khalid

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hbi5raGFsaWRAZ21h aWwuY29tDQoNCg==

Re: Why is Host option Failing? *SOLVED*

am 05.07.2010 21:03:24 von Michael Satterwhite

On Monday, July 05, 2010 01:17:57 pm burhan.khalid@gmail.com wrote:
> Michael:
>
> It could be that MySQL is only listening on localhost (127.0.0.1) and not
> your net IP. Check your network settings in your server config.
> Alternately, you can also do a
>
> netstat -anp | grep mysql
>
> As root and see where it is listening.
>
> Regards,
> --
> Burhan Khalid

Thanks much. This led me to find the problem in the server config. The bind-
address parameter was incorrect.

I appreciate the help everyone gave me. Thank you.
---Michael

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org