Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

mysql logging

Posted on 2002-04-16
3
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
Cook earned 400 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

604 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