April 24, 2008
If you receive this e-mail from your system, issuing the following command would fix the corrupted tables:
mysqlcheck --user=[username] --password=[pwd] --repair -A
April 21, 2008
apt-get install fail2ban
That’s all it takes to install this handy utility. It will monitor different services (ssh, postfix, courier, etc.) for repeated failed login attempts and will block the attacker for a given duration of time. All the settings can be found in
After you have updated the settings file, use:
to reload the new settings.
I was having brute-force dictionary attacks on
pop3 port, fail2ban blocked the attacker within 1 minute. Thanks to the developers.
April 21, 2008
mysql -uusername -ppassword
gets you into MySQL shell
shows all the databases;
create database databasename;
creates a new database
grant all privileges on databasename.* to 'user'@'localhost' identified by 'password';
creates user with password with all privileges on given database
selects a database for further actions
displays the tables in the selected database
drop database databasename;
deletes all tables in databasename and deletes the database.
select * from mysql.user;
lists all the mysql users
drop user xxxx@localhost;
deletes the xxxx user from the localhost
mysqldump --all-databases -p | bzip2 -c > databasebackup.sql.bz2
dumps all mysql data in the compressed databasebackup.sql.bz2 file.
mysqldump -uroot -p databasename | bzip2 -c > databasename.sql.bz2
dumps databasename database in the compressed databasename.sql.bz2 file.