Solved

mysql logging

Posted on 2002-04-16
3
210 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now