This is a discussion on Subject: determining if tables are being used within the MySQL General forum forums, part of the MySQL category; --> Keith, The definitive way is to turn on the query log and watch it for a few days or ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Keith, The definitive way is to turn on the query log and watch it for a few days or weeks. In your my.cnf under [mysqld] add the line: log=mysql-query Then restart your server. In your server's data directory (e.g. /usr/local/mysql/data/), there will now be a log file called mysql-query.log. After some time there may be one for each day, week or size interval. This file, 'mysql-query.log' shows all queries and can be opened, cat'd, tailed, etc. Using the query log impacts performance, comment out the line and restart mysql when you're done. Link to the mysql doc: http://dev.mysql.com/doc/refman/5.0/en/query-log.html -sean On 6/11/07, Keith Murphy <kmurphy@icontact.com> wrote: > > I have inherited database servers from a group whose main job was not > working on mysql. I am not certain if all the tables on the databases are > being used. Is there some efficient way of determining if a table is being > accessed or when the last time it was accessed? > > Thanks, > > Keith > > -- > Keith Murphy > Database Administrator > iContact > 2635 Meridian Parkway, 2nd Floor > Durham, North Carolina 27713 > (o) 919-433-0786 > (c) 850-637-3877 > |