Reset MySQL root password

Reseting MySQL root Password is easy:

1. Stop MySQL

    sudo /etc/init.d/mysql stop

2. Start the mysqld demon process using the –skip-grant-tables option with this command

    sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &

3. Login to MySQL as root.

    mysql -u root mysql

4. You done, flush privileges

    FLUSH PRIVILEGES;

5. You might want to change root password.

    UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
    FLUSH PRIVILEGES;

Virtual screen in Linux

Fire some command, close the terminal go back, connect to screen. If you wish that to happen, Screen will help you. Screen is virtual screen in Linux, (works with Ubuntu and Debian, I tried).

Install it:

$apt-get install screen

Type:

$screen

It takes you to virtual screen. Do some work, or fire some command. Then type Ctrl+a, d. (this will detach from virtual screen). Close your terminal and go for coffee.

Come back, login to box using terminal (any ssh). Type screen -R to connect to virtual screen.

Unable to start eAccelerator module in Unknown on line 0

Have you ever encounter this error (and your Apache can not start)

Unable to start eAccelerator module in Unknown on line 0.

This is because when you upgrade PHP, eAccelerator need to recompile. eAccelerator always seek current version of PHP, so recompile it to get Apache running.

Full log:

SIGHUP received.  Attempting to restart
PHP Warning:  [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6-1+lenny3. Rebuild it for your PHP version (5.2.6-1+lenny9) or download precompiled binaries.\n in Unknown on line 0
PHP Fatal error:  Unable to start eAccelerator module in Unknown on line 0
PHP Warning:  [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6-1+lenny3. Rebuild it for your PHP version (5.2.6-1+lenny9) or download precompiled binaries.\n in Unknown on line 0
PHP Fatal error:  Unable to start eAccelerator module in Unknown on line 0
PHP Warning:  [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6-1+lenny3. Rebuild it for your PHP version (5.2.6-1+lenny9) or download precompiled binaries.\n in Unknown on line 0
PHP Fatal error:  Unable to start eAccelerator module in Unknown on line 0

Useful link:

  1. http://groups.google.com/group/eaccelerator/browse_thread/thread/809899bade9f2238

Useful Tips:

If you want apache running quick, simply move eacceletor.ini from /etc/php5/conf.d. If you don’t have that file, you may want to edit php.ini.