Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error 1045 when connecting via Query Browser

428 views
Skip to first unread message

Ran Shenhar

unread,
Nov 23, 2009, 3:04:20 PM11/23/09
to
Hi,
MySQL NB here.
Got a MySQL on linux.
When connecting from the local machine (mysql -u<user> -p<password>) I
can log in.
When trying from my Win machine to connect using Query Browser, I get
error 1045 "Access denied for user '<user>'@'Windows Machine
IP' (using password: YES).
I tried various combinations of " grant ALL on <DB> to <user>@<IP>;",
but nothing helped so far.

Any hints (except for the obvious "don't use query browser")?

Thanks,

Robert Hairgrove

unread,
Nov 23, 2009, 3:22:20 PM11/23/09
to

In MySQL, users are never identified solely by the user name, but by the
combination of user + host (i.e., the machine or network address from
which the user is coming). It is good for security reasons to have it
this way.

You need to have either a user/host combination of `user`@`*` or else a
user `user`@`<your Windows machine's IP address>` in addition to
`user`@`localhost`. Grant the appropriate permissions to the
combination(s) you need.

Ran Shenhar

unread,
Nov 23, 2009, 3:33:51 PM11/23/09
to

Thanks - but no luck with the grant: mysql> grant ALL on *.* to
'root'@'10.1.2.15';
Query OK, 0 rows affected (0.00 sec)

Jerry Stuckle

unread,
Nov 23, 2009, 4:00:03 PM11/23/09
to

Are these on the same intranet? Did you set up a password for
ro...@10.1.2.15? It is a different user than root@localhost.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Ran Shenhar

unread,
Nov 23, 2009, 4:10:01 PM11/23/09
to
> r...@10.1.2.15?  It is a different user than root@localhost.

>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

Yes, machines are on same intranet and are accessible (ping works, I
can see the connection request running tcpdump on the mysql machine).
No I haven't as I wasn't aware I needed to - how do I go about that?
Also, since my Win is DHCP based, how do I make it general and not IP
specific?

Thanks,

Ran Shenhar

unread,
Nov 23, 2009, 4:18:43 PM11/23/09
to

Following your comment, I saw on mysql.user that my user has no
password, I removed the password from Query Browser - it works.

Thanks for the pointer!

Jerry Stuckle

unread,
Nov 23, 2009, 4:54:35 PM11/23/09
to

There's a whole section in the manual about user account management. I
suggest you read it closely:

http://dev.mysql.com/doc/refman/5.4/en/user-account-management.html

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

jstu...@attglobal.net
==================

Peter H. Coffin

unread,
Nov 23, 2009, 6:08:18 PM11/23/09
to
On Mon, 23 Nov 2009 16:54:35 -0500, Jerry Stuckle wrote:
> Ran Shenhar wrote:
>>
>> Following your comment, I saw on mysql.user that my user has no
>> password, I removed the password from Query Browser - it works.
>>
>> Thanks for the pointer!
>
> There's a whole section in the manual about user account management. I
> suggest you read it closely:
>
> http://dev.mysql.com/doc/refman/5.4/en/user-account-management.html

One thing that bears mentioning that the manual doesn't make very
clear (mostly because everyone writing the manual is already familiar
with this) is that, when talking about user ids and hosts and the need
for adding them, 'localhost' is *special* and means "is connected
through the local, on-machine unix-ish socket file", and that does
*NOT* include connecting through the TCP loopback address frequently
named "localhost". It's also important (slightly less weird, slightly
more specialized) that it's vital to remember that the host connection
specifies the closest connecting point to the db server. Stuff like
phpMyAdmin needs the host to allow whatever user ID access from the
webserver, not the browser's IP address.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting. [TOFU := text oben,
Q: What is the most annoying thing on usenet? followup unten]

Gordon Burditt

unread,
Nov 23, 2009, 10:54:52 PM11/23/09
to
>One thing that bears mentioning that the manual doesn't make very
>clear (mostly because everyone writing the manual is already familiar
>with this) is that, when talking about user ids and hosts and the need
>for adding them, 'localhost' is *special* and means "is connected
>through the local, on-machine unix-ish socket file", and that does
>*NOT* include connecting through the TCP loopback address frequently
>named "localhost".

Another thing worth knowing is that 'Localhost', 'lOcAlHoSt', and
similar names are *not* special and mean "is connected through the TCP

Captain Paralytic

unread,
Nov 24, 2009, 7:35:13 AM11/24/09
to
On 23 Nov, 20:22, Robert Hairgrove <rhairgr...@bigfoot.com> wrote:
> Ran Shenhar wrote:
>
> In MySQL, users are never identified solely by the user name, but by the
> combination of user + host (i.e., the machine or network address from
> which the user is coming). It is good for security reasons to have it
> this way.
>
> You need to have either a user/host combination of `user`@`*` or else a
> user `user`@`<your Windows machine's IP address>` in addition to
> `user`@`localhost`.  Grant the appropriate permissions to the
> combination(s) you need.
Now then, I completely agree with this, but...
In cpanel there is a "Remote MySQL" option where ip addresses can be
listed. These addresses do not appear to be directly related to
specific users (as I would expect and hope them to be). So how is
this enabled?

"Álvaro G. Vicario"

unread,
Nov 24, 2009, 8:03:33 AM11/24/09
to
Captain Paralytic escribi�:

Just a guess... Hosting control panels love to mask real stuff with
their own abstractions. Probably, when you add an IP address Cpanel
simply duplicates existing users.

--
-- http://alvaro.es - �lvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programaci�n web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--

Captain Paralytic

unread,
Nov 24, 2009, 10:24:14 AM11/24/09
to
On 24 Nov, 13:03, "Álvaro G. Vicario"
<alvaro.NOSPAMTH...@demogracia.com.invalid> wrote:
> Captain Paralytic escribió:

>
>
>
>
>
> > On 23 Nov, 20:22, Robert Hairgrove <rhairgr...@bigfoot.com> wrote:
> >> Ran Shenhar wrote:
>
> >> In MySQL, users are never identified solely by the user name, but by the
> >> combination of user + host (i.e., the machine or network address from
> >> which the user is coming). It is good for security reasons to have it
> >> this way.
>
> >> You need to have either a user/host combination of `user`@`*` or else a
> >> user `user`@`<your Windows machine's IP address>` in addition to
> >> `user`@`localhost`.  Grant the appropriate permissions to the
> >> combination(s) you need.
> > Now then, I completely agree with this, but...
> > In cpanel there is a "Remote MySQL" option where ip addresses can be
> > listed. These addresses do not appear to be directly related to
> > specific users (as I would expect and  hope them to be). So how is
> > this enabled?
>
> Just a guess... Hosting control panels love to mask real stuff with
> their own abstractions. Probably, when you add an IP address Cpanel
> simply duplicates existing users.
>
That was sort of my assumption too, but I wondered if anyone knew
definitively.

Mauricio

unread,
Feb 25, 2011, 2:25:50 PM2/25/11
to
Greetings,
My solution to your problem is:

1- Run MySQL Configuration Wizzard.
2- Choose to remove any previous configuration.
3- Restart your MySQL service.
4- Use XAMPP to access your MySQL Database with user "root" and passwrd "" (empty).

Consider getting a place online to host your MySQL database as I did.
First just for a proof of concept, but now I'm running a business site after some try/error issues.
Signup Now with Instant Activation -
<a href="http://www.000webhost.com/420083.html"> free MySQL online webhost</a>

> On Monday, November 23, 2009 3:04 PM Ran Shenhar wrote:

> Hi,
> MySQL NB here.
> Got a MySQL on linux.
> When connecting from the local machine (mysql -u<user> -p<password>) I
> can log in.
> When trying from my Win machine to connect using Query Browser, I get
> error 1045 "Access denied for user '<user>'@'Windows Machine
> IP' (using password: YES).
> I tried various combinations of " grant ALL on <DB> to <user>@<IP>;",
> but nothing helped so far.
>

> Any hints (except for the obvious "do not use query browser")?
>
> Thanks,


>> On Monday, November 23, 2009 3:22 PM Robert Hairgrove wrote:

>> Ran Shenhar wrote:
>>
>> In MySQL, users are never identified solely by the user name, but by the
>> combination of user + host (i.e., the machine or network address from
>> which the user is coming). It is good for security reasons to have it
>> this way.
>>
>> You need to have either a user/host combination of `user`@`*` or else a
>> user `user`@`<your Windows machine's IP address>` in addition to
>> `user`@`localhost`. Grant the appropriate permissions to the
>> combination(s) you need.


>>> On Monday, November 23, 2009 3:33 PM Ran Shenhar wrote:

>>> Thanks - but no luck with the grant: mysql> grant ALL on *.* to
>>> 'root'@'10.1.2.15';
>>> Query OK, 0 rows affected (0.00 sec)


>>>> On Monday, November 23, 2009 4:00 PM Jerry Stuckle wrote:

>>>> Ran Shenhar wrote:
>>>>
>>>> Are these on the same intranet? Did you set up a password for

>>>> ro...@10.1.2.15? It is a different user than root@localhost.


>>>>
>>>> --
>>>> ==================
>>>> Remove the "x" from my email address
>>>> Jerry Stuckle
>>>> JDS Computer Training Corp.

>>>> jstu...@attglobal.net
>>>> ==================


>>>>> On Monday, November 23, 2009 4:10 PM Ran Shenhar wrote:

>>>>> I
>>>>> he
>>>>> a


>>>>>
>>>>> Yes, machines are on same intranet and are accessible (ping works, I
>>>>> can see the connection request running tcpdump on the mysql machine).

>>>>> No I have not as I was not aware I needed to - how do I go about that?


>>>>> Also, since my Win is DHCP based, how do I make it general and not IP
>>>>> specific?
>>>>>
>>>>> Thanks,


>>>>>> On Monday, November 23, 2009 4:18 PM Ran Shenhar wrote:

>>>>>> ) I
>>>>>> et
>>>>>> ",
>>>>>> the
>>>>>> m
>>>>>> t
>>>>>> e a


>>>>>>
>>>>>> Following your comment, I saw on mysql.user that my user has no
>>>>>> password, I removed the password from Query Browser - it works.
>>>>>>
>>>>>> Thanks for the pointer!


>>>>>>> On Monday, November 23, 2009 4:54 PM Jerry Stuckle wrote:

>>>>>>> Ran Shenhar wrote:
>>>>>>>
>>>>>>> There is a whole section in the manual about user account management. I


>>>>>>> suggest you read it closely:
>>>>>>>
>>>>>>> http://dev.mysql.com/doc/refman/5.4/en/user-account-management.html
>>>>>>>

>>>>>>> --
>>>>>>> ==================
>>>>>>> Remove the "x" from my email address
>>>>>>> Jerry Stuckle
>>>>>>> JDS Computer Training Corp.
>>>>>>> jstu...@attglobal.net
>>>>>>> ==================


>>>>>>>> On Monday, November 23, 2009 6:08 PM Peter H. Coffin wrote:

>>>>>>>> One thing that bears mentioning that the manual does not make very


>>>>>>>> clear (mostly because everyone writing the manual is already familiar
>>>>>>>> with this) is that, when talking about user ids and hosts and the need
>>>>>>>> for adding them, 'localhost' is *special* and means "is connected
>>>>>>>> through the local, on-machine unix-ish socket file", and that does
>>>>>>>> *NOT* include connecting through the TCP loopback address frequently

>>>>>>>> named "localhost". it is also important (slightly less weird, slightly
>>>>>>>> more specialized) that it is vital to remember that the host connection


>>>>>>>> specifies the closest connecting point to the db server. Stuff like
>>>>>>>> phpMyAdmin needs the host to allow whatever user ID access from the
>>>>>>>> webserver, not the browser's IP address.
>>>>>>>>
>>>>>>>> --
>>>>>>>> A: Because it messes up the order in which people normally read text.
>>>>>>>> Q: Why is top-posting such a bad thing?
>>>>>>>> A: Top-posting. [TOFU := text oben,
>>>>>>>> Q: What is the most annoying thing on usenet? followup unten]


>>>>>>>>> On Monday, November 23, 2009 10:54 PM gordonb.wpxs wrote:

>>>>>>>>> Another thing worth knowing is that 'Localhost', 'lOcAlHoSt', and
>>>>>>>>> similar names are *not* special and mean "is connected through the TCP
>>>>>>>>> loopback address frequently named "localhost"".


>>>>>>>>>> On Tuesday, November 24, 2009 7:35 AM Captain Paralytic wrote:

>>>>>>>>>> Now then, I completely agree with this, but...
>>>>>>>>>> In cpanel there is a "Remote MySQL" option where ip addresses can be
>>>>>>>>>> listed. These addresses do not appear to be directly related to
>>>>>>>>>> specific users (as I would expect and hope them to be). So how is
>>>>>>>>>> this enabled?


>>>>>>>>>>> On Tuesday, November 24, 2009 8:03 AM ?lvaro_G._Vicario wrote:

>>>>>>>>>>> Captain Paralytic escribi?:


>>>>>>>>>>>
>>>>>>>>>>> Just a guess... Hosting control panels love to mask real stuff with
>>>>>>>>>>> their own abstractions. Probably, when you add an IP address Cpanel
>>>>>>>>>>> simply duplicates existing users.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>

>>>>>>>>>>> --
>>>>>>>>>>> -- http://alvaro.es - ?lvaro G. Vicario - Burgos, Spain
>>>>>>>>>>> -- Mi sitio sobre programaci?n web: http://borrame.com


>>>>>>>>>>> -- Mi web de humor satinado: http://www.demogracia.com
>>>>>>>>>>> --


>>>>>>>>>>>> On Tuesday, November 24, 2009 10:24 AM Captain Paralytic wrote:

>>>>>>>>>>>> On 24 Nov, 13:03, "=C1lvaro G. Vicario"
>>>>>>>>>>>> he
>>>>>>>>>>>> a


>>>>>>>>>>>> That was sort of my assumption too, but I wondered if anyone knew
>>>>>>>>>>>> definitively.


>>>>>>>>>>>> Submitted via EggHeadCafe
>>>>>>>>>>>> SQL Operations on a Text File with ADO.NET
>>>>>>>>>>>> http://www.eggheadcafe.com/tutorials/aspnet/37ed9e1b-c5de-4c0b-afbe-d8f78f9a6ecf/sql-operations-on-a-text-file-with-adonet.aspx

Mauricio

unread,
Feb 25, 2011, 2:28:37 PM2/25/11
to
Greetings,
My solution to your problem is:
1- Run MySQL Configuration Wizzard.
2- Choose to remove any previous configuration.
3- Restart your MySQL service.
4- Use XAMPP to access your MySQL Database with user "root" and passwrd "" (empty).
Consider getting a place online to host your MySQL database as I did.
First just for a proof of concept, but now I'm running a business site after some try/error issues.

http://www.000webhost.com/420083.html

> On Monday, November 23, 2009 3:04 PM Ran Shenhar wrote:

> Any hints (except for the obvious "do not use query browser")?
>
> Thanks,



>>>>>>>>>>>>> On Friday, February 25, 2011 2:25 PM Mauricio wrote:

>>>>>>>>>>>>> Greetings,
>>>>>>>>>>>>>
>>>>>>>>>>>>> My solution to your problem is:
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> 1- Run MySQL Configuration Wizzard.
>>>>>>>>>>>>>
>>>>>>>>>>>>> 2- Choose to remove any previous configuration.
>>>>>>>>>>>>>
>>>>>>>>>>>>> 3- Restart your MySQL service.
>>>>>>>>>>>>>
>>>>>>>>>>>>> 4- Use XAMPP to access your MySQL Database with user "root" and passwrd "" (empty).
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> Consider getting a place online to host your MySQL database as I did.
>>>>>>>>>>>>>
>>>>>>>>>>>>> First just for a proof of concept, but now I'm running a business site after some try/error issues.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Signup Now with Instant Activation -
>>>>>>>>>>>>>
>>>>>>>>>>>>> <a href="http://www.000webhost.com/420083.html"> free MySQL online webhost</a>


>>>>>>>>>>>>> Submitted via EggHeadCafe
>>>>>>>>>>>>> Install Windows Updates using C# & WUAPI
>>>>>>>>>>>>> http://www.eggheadcafe.com/tutorials/aspnet/0e46f5cb-9c67-41fb-b362-4981543fd24b/install-windows-updates-using-c--wuapi.aspx

0 new messages