Recover MySQL root Password

It is only common to forget the database password. However, we can recover MySQL database server password following five easy steps.

  1. First step is to stop the MySQL server process.
    $> sudo /etc/init.d/mysql stop
  2. Start the MySQL (mysqld) server/daemon process with the --skip-grant-tables option so that it will not prompt for the password.
    $> sudo mysqld_safe --skip-grant-tables &
  3. Then, connect to mysql server as the root user.
    $> mysql -u root
  4. Now that we’re in as the root user, setup new mysql root account password i.e. reset mysql password.
  5. mysql> use mysql;
    mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    mysql> flush privileges;
    mysql> quit
  6. Finally, exit and restart the MySQL server.
    $> sudo /etc/init.d/mysql stop
    $> sudo /etc/init.d/mysql start
    $> mysql -u root -p

With this we would’ve successfully changed the password.


Sun Buys MySQL, Gets Oracle for an Enemy

Sun Buys MySQL, Gets Oracle for an Enemy
— Sun, Oracle’s sometimes best friend, turned into an Oracle competitor this morning when it said it was buying MySQL, the open source database that’s part of the famous LAMP stack. It’s paying a billion dollars. MySQL was supposed to go public this year but picked the easier monetization route. Sanford C. Bernstein estimates MySQL?s financial position at breakeven on $60 million-$80 million on trailing 12-month revenues although over 100 million copies of the database have been downloaded. Sun is paying $800 million cash for MySQL’s stock and assuming about $200 million in options. But Sun has been known to overpay for acquisitions before. Remember its fatal $2 billion Cobalt Networks deal?

Article URL:

Using Transactions in MySQL

While surfing through the net today, found this tutorial in Using Transactions in MySQL. Regardless of whether you’ve a novice who’s never heard of transactions before, or someone who’s been tinkering with MySQL for a while (like me), I think you’ll find this article interesting.

An excerpt from the article:

…MySQL is now in use in more than 30,000 installations across the planet and, with large corporate houses like SAP taking an interest in its future development, seems slated to give commercial RDBMS vendors a serious run for their money in the enterprise market…

…One of the newest features in MySQL, and one of the most frequently-requested ones on the MySQL wish list, is transactions. Transactions are found in almost all commercial RDBMSs, and their omission from the MySQL canon has been a source of much hand-wringing amongst MySQL enthusiasts for the last few years. Despite initial resistance to the idea from MySQL HQ (which was understandably concerned about reducing the speed of its RDBMS engine by adding transactional support to it), transactions have finally made an appearance in MySQL 4.0….

Read More