Help needed - mySQL connection problem 
Author Message
 Help needed - mySQL connection problem

Hi,

I'm trying to connect to a mysql server (192.168.1.254) running on a RH
8.0 from another host (192.168.1.2). User is "tsir", db is "prod".

I set the permissions but it's still not working.
Here are the output I get when running these 2 commands:

I

mysql> SELECT Host, User, Select_priv, Insert_priv FROM db WHERE
Db='prod';

+-------------+--------+-------------+-------------+
| Host        | User   | Select_priv | Insert_priv |
+-------------+--------+-------------+-------------+
| localhost   | tsir   | Y           | Y           |
| localhost   | root   | Y           | Y           |
| 192.168.1.2 | tsir   | Y           | Y           |
+-------------+--------+-------------+-------------+
3 rows in set (0.02 sec)

II

mysql> SELECT Host, Select_priv, Insert_priv FROM user WHERE
user='tsir';

+-------------+-------------+-------------+
| Host        | Select_priv | Insert_priv |
+-------------+-------------+-------------+
| localhost   | Y           | Y           |
| 192.168.1.2 | Y           | Y           |
+-------------+-------------+-------------+
2 rows in set (0.00 sec)

What is wrong and how could I fix it?

Help appreciated.

Jim



Tue, 21 Jun 2005 18:54:34 GMT  
 Help needed - mySQL connection problem
Jim was scribbeling:

Quote:
> What is wrong and how could I fix it?

did you flush privileges after your changes?

hth andreas



Tue, 21 Jun 2005 19:42:13 GMT  
 Help needed - mySQL connection problem

Quote:

> Jim was scribbeling:
>> What is wrong and how could I fix it?

> did you flush privileges after your changes?

> hth andreas

Yes I did.  I also restarted the mysql deamon in hope that would help.

Nothing.

Thanx for your input.

Happy new year 2003,

Jim



Tue, 21 Jun 2005 19:47:47 GMT  
 Help needed - mySQL connection problem

Quote:

> Yes I did.  I also restarted the mysql deamon in hope that would help.

Did you set the password using this form:

password='foo'
or this one:
password=password('foo')
?

the first one won't work (it'll set the password, but you won't be able to
use it).

--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.



Tue, 21 Jun 2005 21:55:47 GMT  
 Help needed - mySQL connection problem

Quote:


>> Yes I did.  I also restarted the mysql deamon in hope that would help.

> Did you set the password using this form:

> password='foo'
> or this one:
> password=password('foo')
> ?

> the first one won't work (it'll set the password, but you won't be able to
> use it).

I've tried that as well.  But it's still not working.

Thanx for your input Stephan.

Happy new year 2003



Tue, 21 Jun 2005 23:30:56 GMT  
 Help needed - mySQL connection problem

Quote:

> I've tried that as well.  But it's still not working.

One thing which comes to mind is your hostname:
+-------------+--------+-------------+-------------+
| Host        | User   | Select_priv | Insert_priv |
+-------------+--------+-------------+-------------+
| localhost   | tsir   | Y           | Y           |
| localhost   | root   | Y           | Y           |
| 192.168.1.2 | tsir   | Y           | Y           |
+-------------+--------+-------------+-------------+

Are you certain that your client is connecting with the name localhost?
Perhaps it is connecting using it's real hostname, perhaps with or without
the domain name part? Try adding two new records, one with only the host
part (e.g., mymachine) and one with the FQDN (e.g.,
mymachine.mynetwork.com).

We can see that you can connect to the mysql server, so that part is
definately working. However, can you connect from 192.168.1.2 using a
standard mysql client? i'm *assuming* that the connection problem shows
itself when connecting from a PHP client(?), but i don't have enough info
to know for sure.

--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.



Tue, 21 Jun 2005 23:47:06 GMT  
 Help needed - mySQL connection problem
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In a fit of e{*filter*}ment on Fri, 03 Jan 2003 16:30:56 +0100, "Jim"

Quote:


> >> Yes I did.  I also restarted the mysql deamon in hope that would
> >> help.
> > Did you set the password using this form:

> > password='foo'
> > or this one:
> > password=password('foo')
> > ?

> > the first one won't work (it'll set the password, but you won't be
> > able to  use it).
> I've tried that as well.  But it's still not working.

Jim,

Might be well off here or you migth have looked already, your MySQL
server is configured to accept remote connections isn't it rather than
localhost connections?

I've not config'd for remote access personally but just a thought as
I'm not 100% on how exactly you need to config for remote access (your
OP may be the way but I'm unsure).

Regards,

  Ian

-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.3

iQA/AwUBPhWynWfqtj251CDhEQIP4QCfZP1YwNss8IOvO/WRe3Vga082JOAAoP3r
pKC3I6J0FEvi4KkcGxSesgWi
=tZMY
-----END PGP SIGNATURE-----

--
Ian.H  [Design & Development]
digiServ Network - Web solutions
www.digiserv.net  |  irc.digiserv.net  |  forum.digiserv.net
Scripting, Web design, development & hosting.



Tue, 21 Jun 2005 23:56:15 GMT  
 Help needed - mySQL connection problem
Might be well off here or you migth have looked already, your MySQL

Quote:
> server is configured to accept remote connections isn't it rather than
> localhost connections?

> I've not config'd for remote access personally but just a thought as
> I'm not 100% on how exactly you need to config for remote access (your
> OP may be the way but I'm unsure).

mysql doesn't require any special configuration for this other than the
entries in the rights tables. Postgres, on the other hand, needs to be
started with the -i parameter or an entry needs to be made in the conf
file.

--
----- stephan beal
Registered Linux User #71917 http://counter.li.org
I speak for myself, not my employer. Contents may
be hot. Slippery when wet. Reading disclaimers makes
you go blind. Writing them is worse. You have been Warned.



Wed, 22 Jun 2005 00:03:48 GMT  
 Help needed - mySQL connection problem
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In a fit of e{*filter*}ment on Fri, 03 Jan 2003 17:03:48 +0100, stephan beal

Quote:

> Might be well off here or you migth have looked already, your MySQL
> > server is configured to accept remote connections isn't it rather
> > than localhost connections?

> > I've not config'd for remote access personally but just a thought
> > as I'm not 100% on how exactly you need to config for remote access
> > (your OP may be the way but I'm unsure).

> mysql doesn't require any special configuration for this other than
> the  entries in the rights tables. Postgres, on the other hand, needs
> to be  started with the -i parameter or an entry needs to be made in
> the conf  file.

Thanks Stephan for the clarification, much appreciated =)

Regards,

  Ian

-----BEGIN PGP SIGNATURE-----
Version: PGP Personal Privacy 6.5.3

iQA/AwUBPhW1eGfqtj251CDhEQI9cACgoNZ3bNU5I6+gJxDV4BY2RDWMpRYAnRwo
NJ2K/mt3G25yhkAIyojbvmbf
=TzrP
-----END PGP SIGNATURE-----

--
Ian.H  [Design & Development]
digiServ Network - Web solutions
www.digiserv.net  |  irc.digiserv.net  |  forum.digiserv.net
Scripting, Web design, development & hosting.



Wed, 22 Jun 2005 00:08:26 GMT  
 Help needed - mySQL connection problem

Quote:


> > mysql doesn't require any special configuration for this other than
> > the  entries in the rights tables. Postgres, on the other hand, needs
> > to be  started with the -i parameter or an entry needs to be made in
> > the conf  file.

> Thanks Stephan for the clarification, much appreciated =)

While mysqld normally accepts remote requests, it can be started with
the --skip-networking option, which restricts it to localhost only.

This option is enabled by default (for security) in the configuration
file on some Linux distributions, so it may still be worth checking
/etc/mysql/my.cnf (or your equivalent file) to make sure.

--
Chris



Wed, 22 Jun 2005 00:15:08 GMT  
 Help needed - mySQL connection problem

Quote:
> Hi,

> I'm trying to connect to a mysql server (192.168.1.254) running on a RH
> 8.0 from another host (192.168.1.2). User is "tsir", db is "prod".

> I set the permissions but it's still not working.

What is *it* trying to do when *it's* not working?

Why not post the code that's not working, especially the "submit" action of
any form that 192.168.1.2 using in a cgi transaction?

What did your server logs tell you about the failed transactions?

Cheers.

Bill Segraves



Wed, 22 Jun 2005 00:34:28 GMT  
 Help needed - mySQL connection problem

Quote:



>> > mysql doesn't require any special configuration for this other than
>> > the  entries in the rights tables. Postgres, on the other hand, needs
>> > to be  started with the -i parameter or an entry needs to be made in
>> > the conf  file.

>> Thanks Stephan for the clarification, much appreciated =)

> While mysqld normally accepts remote requests, it can be started with
> the --skip-networking option, which restricts it to localhost only.

> This option is enabled by default (for security) in the configuration
> file on some Linux distributions, so it may still be worth checking
> /etc/mysql/my.cnf (or your equivalent file) to make sure.

Thanx Chris.  But no pb here in /etc/my.cfg (RH 8.0)

Happy New year 2003.

Jim



Thu, 23 Jun 2005 02:54:17 GMT  
 Help needed - mySQL connection problem

Quote:


>> I've tried that as well.  But it's still not working.

> One thing which comes to mind is your hostname:
> +-------------+--------+-------------+-------------+
> | Host        | User   | Select_priv | Insert_priv |
> +-------------+--------+-------------+-------------+
> | localhost   | tsir   | Y           | Y           |
> | localhost   | root   | Y           | Y           |
> | 192.168.1.2 | tsir   | Y           | Y           |
> +-------------+--------+-------------+-------------+

> Are you certain that your client is connecting with the name localhost?
> Perhaps it is connecting using it's real hostname, perhaps with or without
> the domain name part? Try adding two new records, one with only the host
> part (e.g., mymachine) and one with the FQDN (e.g.,
> mymachine.mynetwork.com).

> We can see that you can connect to the mysql server, so that part is
> definately working. However, can you connect from 192.168.1.2 using a
> standard mysql client? i'm *assuming* that the connection problem shows
> itself when connecting from a PHP client(?), but i don't have enough info
> to know for sure.

OK,  This is what my error log says when trying to connect.
BTW, I'm trying to connect from both PHP clients an others as well with
same pb.  I can actually connect to mysql with PHP using this sample
script:

<?php


        or die("Couldn't connect.");if ($connection)

{$message = "Successful mySQL connection.";}

?>

<html>

<head>
        <title>mySQL Test</title>
</head>

<body>

<?php

echo "$message";

?>

</body>

</html>

I call this ???.php script from a webpage and it IS successful.  of
course, it's not connecting to any db in particular.
When I run this simple test, no entry is created in the logfile.

However, when I try to connect to a specific db using non-PHP clients on a
MacOS (haven't tried with PHP yet), I get the following error log:

Number of processes running now: 1
mysqld process{*filter*}, pid 4708 - killed
030104 20:05:56  mysqld restarted
030104 20:05:56  InnoDB: Out of memory in additional memory pool.
InnoDB: InnoDB will start allocating memory from the OS.
InnoDB: You may get better performance if you configure a bigger
InnoDB: value in the MySQL my.cnf file for
InnoDB: innodb_additional_mem_pool_size.
030104 20:05:57  InnoDB: Started
/usr/libexec/mysqld: ready for connections

With InnoDB deactivated I get the first 3 lines.

I've been using Linux since 1993 but never used mySQL before.  So, sorry
for what may seem like stupid questions.

Jim



Thu, 23 Jun 2005 03:17:02 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Remote MySQL Connection Problem

2. MySQL connection problem with linux

3. HELP: MySQL Connection

4. Newbie Help with php connection to mysql

5. Need help by VAST Web Connection

6. VW5i1 Oracle Connection: help needed

7. Need Help with mxODBC Connection String

8. Need Help - OLE/OCX connection to ODBMS

9. DB connections on Unix to MySQL

10. Connection to remote server with MySQL under Win/2K

11. Newbie needs help setting up user MySQL thru PHP

12. PHP, mySQL and connection to a SQL Database

 

 
Powered by phpBB® Forum Software