Entries from August 2007 ↓

Change MySQL root password

So you forgot your MySQL root password ? Don’t worry, logging in is easy as 1,2,3:

  1. Stop all running mysqld processes (/etc/init.d/mysqld stop or killall mysqld)
  2. # mysqld –skip-grant-tables
  3. $ mysql -uroot and you’re in, no password required

Till here, you’ll be able to operate with your DB…but, you’ll not be able to change your password right away:

mysql> SET PASSWORD FOR root = PASSWORD('will_not_forget_again');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables
option so it cannot execute this statement

Here’s the workaround:

mysql> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE user
    -> SET PASSWORD=PASSWORD('really:I_will_not_forget_again')
    -> WHERE user="root";
Query OK, 2 rows affected (0.02 sec)
Rows matched: 2  Changed: 2  Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

Thanks to netadmintools for this quick recipe :)

Ben tip d’SPAM: Greylisting i SPF

SPAM

La batalla continua indefinidament: es milloren els motors antispam (spamassassin, dspam…) i els spammers s’adapten, s’usen llistes negres remotes (RBL’s) i ells s’adapten… que un gif com attachment pot tenir pinta d’spam ? Doncs ells usen PDF’s… el compte de mai acabar :/

Doncs bé, fart de rebre una mitja de 10 spams diaris a l’Inbox vaig decidir implantar mesures dràstiques. Primer vaig probar amb greylisting (usant postgrey). El resultat va ser decepcionant: apenes filtrava un 10% més dels spams respecte a no tenir aquesta mesura.

La capacitat d’adaptació i perseverança dels spammers em recorda a uns personatges d’una sèrie de ciència ficció :-/… El cas és que finalment em vaig decantar per SPF… conclusió després de setmanes d’ús i revisió de logs exhaustiva: tant de bo ho hagués fet abans !

Continue reading →