Play with show connections; un mysql cli try help show; and check the …

Comment on Fix MySQL connection error – Host ” is blocked because of many connection errors; unblock with ‘mysqladmin flush-hosts’ by admin.

Play with show connections; un mysql cli

try

help show;

and check the arguments.

 

Regards,

Georgi

Recent Comments by admin

Squid Proxy log timestamp human readable / Convert and beautify Proxy unixtime logs in human-readable form howto
Other useful thing is the Convert Nagios Log Timestamp to Human Readable Format

Below is how

[root@foo1 ~]# cat /usr/local/nagios/var/nagios.log | perl -pe 's/(d+)/localtime($1)/e'


Optimizing Linux TCP/IP Networking to increase Linux Servers Performance
More useful sysctl options under some circumstances:

http://pc-freak.net/files/sysctl-server-performance.conf


Prevent rsync cronjob to run multiple times via cronjob on Linux
Another way I just red on a blog is as follows:

 

$ crontab -l
* * * * * /path/to/cron.sh

The command above will, just as the first example, execute our PHP script every minute through a bash script. To prevent it from overlapping, it can also be changed to this.

$ crontab -l
* * * * * /usr/bin/pgrep -f /path/to/cron.sh > /dev/null 2> /dev/null || /path/to/cron.sh

The pgrep command will return false if it does not find a running process matching the first argument, /path/to/cron.sh. If it returns false, it'll process the second part of the OR comparison (the double vertical line, ||). If the running process was found, pgrep will return the Process ID (PID) and Bash will not continue to the second part of the OR statement since the first already returned true.

The trick here is to use very unique scriptnames. If the name is too generic (such as "cron.sh"), pgrep may return Process IDs from other running cron jobs and not execute the cron you wanted.


Prevent rsync cronjob to run multiple times via cronjob on Linux
Here is another life time example with flock:
 

*/5 * * * * /usr/bin/rsync –delete -a source_server:/source/path/ /dst/path/

Example using flock:

*/5 * * * * flock -xn /tmp/example.lock -c '/usr/bin/rsync –delete -a source_server:/source/path/ /dst/path/'


Create SFTP CHROOT Jail User for data transfer to better Linux shared web hosting server security
After reboot if you have remote filesystem mounted which for some reason mounted by mistake as read only or for some reason turned into readonly you can check for such behavior with a quick liner too

fs='/ /var /tmp /usr';
for i in $fs ; do cd $i; touch d2; if [ "$?" -eq 0 ]; then  echo " $i is writable"; else echo "$i is not writable"; fi; done


Share this on:

No Responses to “Play with show connections; un mysql cli try help show; and check the …”

  1. Mr WordPress says:
    Unknown Unknown Unknown Unknown

    Hi, this is a comment.
    To delete a comment, just log in and view the post's comments. There you will have the option to edit or delete them.

    View CommentView Comment