Tuesday, April 19, 2016

How reset mysql root password ??

To reset the password

Follow these steps (can be helpful if you really forget your password and you can try it anytime, even if you're not in the situation at the moment):
  1. Stop mysql
    sudo /etc/init.d/mysql stop
    or for other distro versions
    sudo /etc/init.d/mysqld stop
  2. Start MySQL in safe mode
    sudo mysqld_safe --skip-grant-tables &
  3. Log into MySQL using root
    mysql -uroot
  4. Select the MySQL database to use
    use mysql;
  5. Reset the password
    update user set password=PASSWORD("mynewpassword") where User='root';
  6. Flush the privileges
    flush privileges;
  7. Restart the server
    quit
  8. Stop and start the server again
    ubuntu and debian
    sudo /etc/init.d/mysql stop
    ...
    sudo /etc/init.d/mysql start
    On CentOS and Fedora and RHEL
    sudo /etc/init.d/mysqld stop
    ...
    sudo /etc/init.d/mysqld start
  9. Login with new password
    mysql -u root -p
  10. Type new password and enjoy your server again like nothing happened

Tuesday, April 12, 2016

This compilation unit is not on the build path of a Java project





If you ever face this issue in eclipse, you have to add the below java natures in .project file, which is available in your project's home directory. After adding these lines restart your eclipse. It should work !!!


.project file :
---------------

        <natures>
<nature>org.sonar.ide.eclipse.core.sonarNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>