Solved

mysql logging

Posted on 2002-04-16
3
213 Views
Last Modified: 2010-04-20
hihi,
I found many mysql processes are running in my linux server, How can I know which users or programs connecting to mysql databases?
Any log I can look at about this?

0
Comment
Question by:stanleyhuen
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Cook earned 100 total points
ID: 6947698
Mysql's general logfile (default in the server's data-directory) reports on client connections, queries, who is connecting from where and what are they doing.

To enable logging, use the --log option to turn on the general log and the --log-update option to turn on the update log (this logs queries that modify the database). You can specify these options on the command line for mysqld, safe_mysqld, or mysql.server, or in the "mysqld" group in an option file.

On busy servers, make sure you monitor the size of your logfiles (make a rotation scheme).

Some usefull information can be obtained by some mysqladmin options (eg extended-status/processlist/variables/version)

In addition, netstat -na is always usefull :)

cheers.
0
 

Author Comment

by:stanleyhuen
ID: 6952368
Thanks Cook.
I found now 100 mysql connections are not enough,
my linux server is p3 800, 384MB RAM, 40 GB, I want to set the max_connections to 300, is it OK?
0
 
LVL 1

Expert Comment

by:Cook
ID: 6958225
This would allow for 300 + 1 simultanious connections to the mysql server.

Tuning the database is a delicat matter.
e.g. when you augment the number of simultanious connections, you should also adjust the table_cache.  

(Increasing this value allows mysqld to keep more tables open simultaneously and reduces the number of file opens and closes that must be done.  Keep in mind that increasing these values requires a larger number of file descriptors. Eventually, That could cause problems with operating system limits)

By adjusting the variables and monitoring the resources (top) you get an idea of your application's demands.


0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question