SQL Thread is not running When relay log is corrupted  , meaning the slave server is stopped unexpectedly How to fix: run show slave , we’ll see the IO thread running but SQL thread is not working. check Relay_Log_File name , for example , mysqld_3308-relay-bin.000044 then we know that 44 is corrupted, so we’ll increase it stop slave; change MASTER To Relay_Log_File=’mysqld_3308-relay-bin.000045′,Relay_Log_Pos=4; start slave; SQL IO is not runnning run show slave to check Master_Log_File  value , then increase it to 1 Check  : Master_Log_File mysql-bin.003591 stop slave; change MASTER To Master_Log_File=’mysql-bin.003592′,MASTER_LOG_POS=4; start slave;  Read More →

Dump multiple databases: mysqldump -u root -p –databases db1 db2 db3 >dump.sql Dump some selected tables: mysqldump -u mysqlusername -p databasename table1 table2 table3 > databasebackup.sql Dome all tables except some tables: mysqldump -u username -p database –ignore-table=database.table1 –ignore-table=database.table2 > database.sql  Read More →

Set all ssh account to use bash shell by default , /etc/passwd Make sure that you have install exim or postfix or any other email tool to send mail Edit /etc/bash.bashrc , and the below lines echo ‘Date:’ date $’\n’WhoAmI: whoami \ $’\n’Who: $’\n'”who” \ $’\n’Netstat: $’\n'”netstat -nt | grep EST” \ $’\n’Process: $’\n'”ps -aux” \ | mail -aFrom:[email protected] -s “Security Alert: SSH Access(hostname -s)” [email protected] This script will send the following info : Date , WhoAMI, who , netstat, processlist Test (1) Copying the above code in your shell and run , make sure that you receive the email (2) Login to the serverRead More →

When you run apt-get install , you got some error this dpkg: dependency problems prevent configuration of linux-server: linux-server depends on linux-image-server (= 3.2.0.88.102); however: Version of linux-image-server on system is 3.2.0.113.129. linux-server depends on linux-headers-server (= 3.2.0.88.102); however: Version of linux-headers-server on system is 3.2.0.113.129. dpkg: error processing linux-server (–configure): Run the following command will fix the issue: apt-get remove linux-server apt-get install linux-serverRead More →

For some reason, when Vigor with Firmware 3.2 , it doesn’t work well with Palo Alto PA500 , especially Yahoo. When Palo Alto make the request with cookies > 1000 characters, Vigor will not return the result. In this interesting issue, if you use WIndows , you don’t see the problems, install a Ubuntu , you can replicate the issue. The solution is to upgrade firmware to 3.3Read More →

my mysql nagios plugin doesn’t work, tested with this command /usr/lib/nagios/plugins/check_mysql Error error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory It’s probably Ubuntu 16.04 is using higher mysql client version, while the nagios use lower version Here is the fix: cd ~root wget http://files.directadmin.com/services/debian_7.0_64/libmysqlclient.so.18 copy libmysqlclient.so.18 /usr/lib/x86_64-linux-gnu/ cd /usr/lib/x86_64-linux-gnu chmod 755 libmysqlclient.so.18 ldconfigRead More →

If you just uncomment the slow query log variable in mysqld.conf , you can’t start your mysql server. it’s because the variable name has changed, the following configuration works well for me. nano /etc/mysql/mysql.conf.d/mysqld.conf # Here you can see queries with especially long duration slow_query_log = 1 slow_query_log_file = /var/log/mysql/slow-queries.log long_query_time = 1Read More →

This works well on my Ubuntu 14.04 Based on http://fearby.com/article/update-openssl-on-a-digital-ocean-vm/ Method1: $ sudo apt-get update $sudo apt-get install –only-upgrade libssl1.0.0 openssl #check if it patches successfully. $ zgrep -ie “(CVE-2016-2108|CVE-2016-2107)” /usr/share/doc/libssl1.0.0/changelog.Debian.gz Output should be like this: debian/patches/CVE-2016-2107.patch: check that there are enough CVE-2016-2107 debian/patches/CVE-2016-2108-1.patch: don’t mishandle zero if it is debian/patches/CVE-2016-2108-2.patch: fix ASN1_INTEGER handling in CVE-2016-2108 Method2: $ sudo apt-get dist-upgrade $ wget ftp://ftp.openssl.org/source/openssl-1.0.2h.tar.gz $ tar -xvzf openssl-1.0.2h.tar.gz $ cd openssl-1.0.2h $ ./config –prefix=/usr/ $ make depend $ sudo make install $ openssl version OpenSSL 1.0.2h 3 May 2016 now restart your nginx or other server $ sudo service nginx restart check your website hereRead More →