useful mysql command

show status like ‘Qcache%’;

explain select …..

分析 schema 

echo “select * from tbl_item procedure analyse()\G” | mysql db_name > ana.txt

adject file descriptors

On Unix, each TCP/IP connection uses a file descriptor, so you must increase the total number of descriptors available to the operating system, and also increase the maximum number of descriptors each process is allowed to use. All Unix style operating systems have a “ulimit” shell command (sh and bash) which can allow more open file descriptors to commands started in that shell, once the appropriate kernel tweak has been made. We recommend “ulimit -n 8192”. Here are our recommended kernel tweaks:

Linux: “echo 65536 > /proc/sys/fs/file-max” changes the number of system-wide file descriptors

FreeBSD: append to /etc/sysctl (or you can use sysctl -w to add these)

kern.maxfiles=65536
kern.maxfilesperproc=32768

Solaris: add the following to /etc/system and reboot:

set rlim_fd_max=0x8000
set rlim_fd_cur=0x8000