Set / Change / Reset the MySQL root password on Ubuntu/Debian Linux

Stop the MySQL Server

sudo /etc/init.d/mysql stop

Start the mysqld configuration.

sudo mysqld --skip-grant-tables &

Login to MySQL as root

mysql -u root mysql

Replace YOURNEWPASSWORD with your new password!

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

This worked for me at the last step changedthe user with root and gave the password

Advertisements

Installing Node.js and NPM on Ubuntu/Debian

This is the simple way to install Node.js and npm which is needed for the installation of coco2d javascript

Step 1 – Update your system

sudo apt-get update
sudo apt-get install git-core curl build-essential openssl libssl-dev

Step 2 – Install Node.js

First, clone the Node.js repository:

git clone https://github.com/joyent/node.git
cd node

Now, if you require a specific version of Node:

git tag # Gives you a list of released versions
git checkout v0.4.12

Then compile and install Node like this:

./configure
make
sudo make install

Then, check if node was installed correctly:

node -v

Step 3 – Install NPM

Simply run the NPM install script:

curl http://npmjs.org/install.sh | sudo sh

And then check it works:

npm -v
 Happy Hacking