Solved

mysql logging

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

Suggested Solutions

Title # Comments Views Activity
winscp 000webhost.com 6 100
lunix and unix command 21 116
Granting root permissions to a user (in Debian Jessie) 17 53
Linux 3 34
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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