timeout

2009-01-17 Thread Mosaed zamil
hello all,
When I send : mysql -h  address -u root -p  from a distant computer I don't
get connected. I think it is a timeout problem.
How can I increase the timeout period.
TIA
mosaed


Re: timeout

2009-01-17 Thread Claudio Nanni
If you do not connect probably you have a firewall in between,
and it is not a timeout problem.
You should ask your network administrators to open, if possible, that port
for you.
Another option is to ssh to the host and do a local connection to the MySQL
instance.

Cheers
Claudio Nanni


2009/1/17 Mosaed zamil mzamils...@gmail.com

 hello all,
 When I send : mysql -h  address -u root -p  from a distant computer I don't
 get connected. I think it is a timeout problem.
 How can I increase the timeout period.
 TIA
 mosaed



Re: timeout

2009-01-17 Thread Jim Lyons
First, be sure you can access the host - try pinging it.

Second, if you can ping the computer so you know there's no network issue,
be sure you've got the mysql permissions to connect from that host to either
the server or the database (if you specify one).  You may have permission to
connect locally or from specific computers, but unless you have an entry in
mysql.user that allow you to connect either from address (as in your
example) or % or some wildcarded address that includes you domain, you're
not permitted to enter.

Once you've eliminated these potential problems and you still can't connect
contact the sys admin of the remote computer.

On Sat, Jan 17, 2009 at 3:07 AM, Mosaed zamil mzamils...@gmail.com wrote:

 hello all,
 When I send : mysql -h  address -u root -p  from a distant computer I don't
 get connected. I think it is a timeout problem.
 How can I increase the timeout period.
 TIA
 mosaed




-- 
Jim Lyons
Web developer / Database administrator
http://www.weblyons.com


RE: timeout

2009-01-17 Thread Martin Gainty

from a purely network point of view PING works if ICMP traffic is allowed
do a tracert and find out which intervening node is rerouting the traffic
you might have something funky on the routing tables

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




 Date: Sat, 17 Jan 2009 07:51:55 -0600
 Subject: Re: timeout
 From: jlyons4...@gmail.com
 To: mzamils...@gmail.com
 CC: mysql@lists.mysql.com
 
 First, be sure you can access the host - try pinging it.
 
 Second, if you can ping the computer so you know there's no network issue,
 be sure you've got the mysql permissions to connect from that host to either
 the server or the database (if you specify one).  You may have permission to
 connect locally or from specific computers, but unless you have an entry in
 mysql.user that allow you to connect either from address (as in your
 example) or % or some wildcarded address that includes you domain, you're
 not permitted to enter.
 
 Once you've eliminated these potential problems and you still can't connect
 contact the sys admin of the remote computer.
 
 On Sat, Jan 17, 2009 at 3:07 AM, Mosaed zamil mzamils...@gmail.com wrote:
 
  hello all,
  When I send : mysql -h  address -u root -p  from a distant computer I don't
  get connected. I think it is a timeout problem.
  How can I increase the timeout period.
  TIA
  mosaed
 
 
 
 
 -- 
 Jim Lyons
 Web developer / Database administrator
 http://www.weblyons.com

_
Windows Liveā„¢: Keep your life in sync. 
http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_allup_howitworks_012009

Re: help refactoring query

2009-01-17 Thread Shawn Green

b wrote:
I'm having some difficulty getting my head around a particular query. 
I'd like to make this a view once I get something working. However, all 
I've been able to come up with uses a sub-query. So, no view on the 
horizon.


I have 3 tables:

users
  id,
  (etc. the usual)

disciplines
  id,
  name (ie. film, photography, writing, etc.)

disciplines_users
  discipline_id,
  user_id

Each user may have one or more discipline.

The view I'm looking for shows the total number of users who have a 
particular discipline. NOTE: the sum of the totals is greater than the 
total number of users, which is by design.


SELECT name, COUNT(discipline.u_id) AS total
FROM (
  SELECT du.discipline_id, du.user_id as u_id, d.name
  FROM disciplines_users AS du
  LEFT JOIN disciplines AS d
  ON d.id = du.discipline_id
) AS discipline
GROUP BY discipline.name ORDER BY discipline.name;


+-+---+
| name| total |
+-+---+
| Dance   |   176 |
| Film and Television |   376 |
etc.


I've a feeling that this could be done without that sub-query and using 
another join. If not, I might make the sub-query its own view and see 
what the performance is like. I'd appreciate any suggestions, especially 
any pointers on refactoring sub-queries into joins, in general.






Why not use just your subquery as your VIEW?

SELECT d.id, d.name, du.user_id as u_id,
FROM disciplines AS d
LEFT JOIN disciplines_users AS du
  ON d.id = du.discipline_id
GROUP BY d.id, d.name

The reason I inverted the FROM and LEFT JOIN was so that if you had a 
discipline with 0 users, you can now see a zero. In your original 
orientation, a relationship had to exist or its discipline wouldn't have 
been counted.


--
Shawn Green, MySQL Senior Support Engineer
Sun Microsystems, Inc.
Office: Blountville, TN

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



MySQL v5.1 loses connection if too many updates in loop

2009-01-17 Thread mos
I updated from MySQL 5.01 to 5.1 a few days ago. My Delphi application runs 
on XP with 3GB ram.


I have a query #1 that executes a simple Select statement that fetches 5000 
rows from a single table sorted by date. (no joins)


Inside a loop if any rows need to be updated, another query #2 will update 
that row and then a Next statement goes to the next row in Query#1 and this 
repeats until all the rows from the table are traversed. This seems pretty 
simple and has worked fine in v5.0.1. Since upgrading to v5.1.30 after a 
few hundred rows have been updated, the Next statement will hang for 60 
seconds and then I get a lost connection to mysql server message. If I 
take the updates out of the loop, it completes just fine. So why are a few 
thousand updates causing a problem inside of a loop? The updates are 
updating 1 row at a time and does not alter any of the keys in the table.


TIA
Mike


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org