How to , and other stuff about linux, photo, php … A linux, photography blog. To remember some linux situation, and fix them quickly.

March 31, 2008

mysqladmin flush-hosts

Filed under: Linux — admin @ 2:23 pm

Host ‘…’ is blocked Error

If you get an error like this:

Host ‘hostname’ is blocked because of many connection errors.
Unblock with ‘mysqladmin flush-hosts’

This means that mysqld has gotten a lot (max_connect_errors) of connect requests from the host ‘hostname’ that have been interrupted in the middle. After max_connect_errors failed requests, mysqld assumes that something is wrong (like an attack from a cracker), and blocks the site from further connections until you execute a mysqladmin flush-hosts command or issue a FLUSH HOSTS statement.

By default, mysqld blocks a host after 10 connection errors. You can easily adjust this by starting the server like this:

shell> mysqld_safe -O max_connect_errors=10000 &

Note that if you get this error message for a given host, you should first check that there isn’t anything wrong with TCP/IP connections from that host. If your TCP/IP connections aren’t working, it won’t do you any good to increase the value of the max_connect_errors variable!

/bin/rm: Argument list too long

Filed under: Linux — admin @ 2:23 pm

If you try to remove some file and recive that error. Then one solution is to combine find with xargs.

find . -name ‘spam-*’ | xargs rm

This will send one line to the rm command.

If the filenames involved have spaces, you will need to do use find’s
“-print0” option in conjunction with xargs’s “-0” option. otherwise the
shell that xargs uses to execute the “rm” command line will treat the
space as a token separator, thereby treating the name as two (or more)
names, none of which are the thing you’re trying to actually delete.
the command line should look like this…

find . -name ‘spam-*’ -print0 | xargs -0 rm

How to Use SSH

Filed under: Linux — admin @ 2:22 pm

This is the most simplest tutorial of SSH. I had been surfing the Internet for a long
time to get this done, but it was not getting done.
Here are the steps that anyone should follow.

(more…)

How to restore/repair/recover a mySQL Database/Table

Filed under: Linux — admin @ 2:21 pm

From time to time mySQL databases can get corrupt, whether it due to lack of disk space, power failure, or just an error.

Repairing MyISAM mySQL Tables/Databases:

cd /var/lib/mysql/DBNAME
#^ Please note that we assume your mySQL data directory is /var/lib/mysql

myisamchk *.MYI

Repairing ISAM mySQL Tables/Databases:

cd /var/lib/mysql/DBNAME
#^ Please note that we assume your mySQL data directory is /var/lib/mysql

isamchk *.MYI

Viewing .htaccess via FTP using Total Commander

Filed under: Linux — admin @ 2:21 pm

If you are using Total Commander, and you didn’t see the hidden files from a remote ftp server.

Then you should edit wcx_ftp.ini (standard installation it’s in c:\windows\wcx_ftp.ini )

After the [General] section please add
FtpShowHidden=1

Save the file, restart the Total Commander, and after that you should see all files.

« Newer PostsOlder Posts »

Powered by WordPress