mysql open files

mbharanim
mbharanim used Ask the Experts™
on
mysql> show status like 'open%';
+--------------------------+-------+
| Variable_name            | Value |
+--------------------------+-------+
| Open_files               | 2     |
| Open_streams             | 0     |
| Open_table_definitions   | 15    |
| Open_tables              | 1     |
| Opened_files             | 60    |
| Opened_table_definitions | 0     |
| Opened_tables            | 0     |
+--------------------------+-------+
7 rows in set (0.00 sec)



in mysql 5.0 when how to see what are the actual Opened_table_definitions ?

flush tables command doesnot reduce the "Opened_files" but only affects the open files.

how to reduce the opened files and see what are they ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
What version of MySQL do you have?  I have 5.0.51a and it only shows 4 of the seven items in your list.  The MySQL docs say that "Opened_files" is the number of files that Have been opened, not that are currently open.  Same with 'Opened_tables'.

Author

Commented:
The version of mysql i am using is :
Server version: 5.1.30-community MySQL Community Server (GPL)

Also Can I exactly see what are the actual files opened ?

Commented:
you can use lsof but it has nothing to do with mysql.
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Author

Commented:
Thanks for your quick reply !

Do you mean that the number of opened files listed by mysql are the files opened by the OS and not mysql ?

And if I want to see the opened files via mysql what should I do ?

Commented:
to be more precise, under ubuntu as example, install lsof, then:

sudo lsof | grep mysql

here you are.

concerning reseting the count, you need to restart mysql.

Author

Commented:
If possible could you tell me how to do this on solaris ?
I mean does lsof work on solaris ?
Commented:
and if solaris version >= 10 I've heard pfiles was telling filenames.

Author

Commented:
Solved

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial