Solved

mysql logging

Posted on 2002-04-16
3
211 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

914 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

18 Experts available now in Live!

Get 1:1 Help Now