By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,978 Members | 1,362 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,978 IT Pros & Developers. It's quick & easy.

MySQL server initialize broken connections?

P: n/a
Hi!

I'm working on program that acts as MySQL client. After successful connection
program send queries for a long time. When I stop server mysql_query return
error (no surprise). But when I start server my program recieve information
again without connection reinitialization.

I suppose MySQL server track connections somehow but I didn't find any info
about it in documentation. Can somebody point me to docs or explain this
behaviour?

Additional information:

MySQL version: 4.1.9
Connection type: TCP socket

Thank you.

--
Dmitry Davletbaev.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Dmitry Davletbaev wrote:
I'm working on program that acts as MySQL client. After
successful connection program send queries for a long time.
When I stop server mysql_query return error (no surprise).
But when I start server my program recieve information again
without connection reinitialization.
I don't see anything illogical in this behaviour.

I'ld say the following is going on (chronologically):

(1) Your MySQL client program requests authentication from the user
(or has built-in authentication).
(2) Your MySQL client program uses this authentication info to build
up a connection with the MySQL server. This same authentication info
is sent to the server every time a query is executed.
(3) When authentication is OK, the query will be executed and the
server will respond to the client with a query result set (or an
error, but at least the connection and authorization were successful
here).

Steps (2) and (3) are repeated each time a query is sent. Each query
is authorized separately. Obviously, if mysqld is not running, you
will get an error when sending queries to it. When mysqld runs again
(eg when you have restarted it), queries can be processed again. That
has nothing to do with the client. The client only knows the response
it gets after having sent a request.
I suppose MySQL server track connections somehow but I
didn't find any info about it in documentation. Can somebody
point me to docs or explain this behaviour?


All logs should be created in the mysqld data directory. On my system
(MySQL 4.0 on FreeBSD 4) that is /usr/local/var/logs/.

Log tracking is explained in chapter 5.10. of the MySQL Manual:

http://dev.mysql.com/doc/mysql/en/log-files.html

--
Bart
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.