Sunday, March 7, 2010

Mysql Monitoring Script

Mysql to CVS file:


--------------------------------------------------------------------
>>>>>>>>>>SELECT * FROM user where User='root' INTO OUTFILE '/tmp/root_user.txt';

>>>>>>>>>>LOAD DATA INFILE '/tmp/root_user.txt' INTO TABLE user

>>>>>>>>>select User,Host from user where User='root';



>>>>>>>>>mysql -u uid -ppwd -D dbname << EOQ | sed -e 's/        /,/g' | tee list.csv
select id, concat("\"",name,"\"") as name
from students
EOQ


command[check_mysqld]=/usr/lib/nagios/plugins/check_mysql_query -q 'select 1+2' -u nagiosCheck -p 'password' -w 3:3 -c 3:3


--------------------------------------------------------------------

http://tlug.dnho.net/node/209
http://dev.mysql.com/doc/refman/4.1/en/select.html
http://forums.mysql.com/read.php?93,217055,220349#msg-220349
http://eoslist.com/open_source/directory/database.html
http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html

No comments:

Post a Comment

 Linux Interview  Linux booting process EXT4 XFS file system runlevel scan disk hba driver systool -c fc_host lspci -nn | grep -i hba single...