Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Aug 202010
 

Block a client from connecting to MySQL if too many errors

Answer:

You can block a client from connecting to MySQL if they introduced too many errors, e.g. sending incorrect password for authentication, insufficient privileges when connecting to a database etc.

To set the number of maximum allowed error, edit the MySQL configurations, e.g. /etc/my.cnf

..
max_connect_errors=100
..

So if a client exceeded this value, they will be blocked from connecting to the server.

Don't forget to restart MySQL to take effect.

# /sbin/service mysqld restart

Aug 192010
 

Downgrade the format of a Subversion working copy

Answer:

Sometimes, when you upgraded the local subversion working copy, but others use an older client to access it, error likes "This client is too old to work with working copy..." will appear.

To fix this, you can consider downgrade the format of the subversion working copy.

E.g. Downgrade to 1.4

# change-svn-wc-format.py /path/to/working/copy 1.4

The useful python script can be downloaded here: http://svn.apache.org/repos/asf/subversion/trunk/tools/client-side/change-svn-wc-format.py

Aug 172010
 

Set the maximum allowed number of connections in MySQL

Answer:

MySQL has a setting which prevent the database from overloaded due to too many concurrent connections. This value should depends on the processing power of your database server, e.g. CPU, memory, disks I/O.

To change the value, edit the MySQL configurations, e.g. /etc/my.cnf

..
max_connections=100
..

So if a client connecting to the database exceeded this value, they will be blocked.

Don't forget to restart MySQL to take effect.

# /sbin/service mysqld restart

Aug 162010
 

A simple array in Perl

Answer:

Array is a list like data structure in Perl. It allows you to access to the elements inside the array sequentially.

Example:

use strict;
use warnings;

my @a = (1, 2, 3);

print $a[2]; # print '3', since Perl array is zero-indexed