It happens that sometimes (after 2 days 🙂 ) you forget the password for your root user on MySQL, well there are few steps to perform to recover it.
This was performed on version:
$ mysql -V mysql Ver 14.14 Distrib 5.1.61, for debian-linux-gnu (x86_64) using readline 6.2
The following steps need to be performed as root user, so either login with it or use sudo.
Step 1:Stop the MySQL service
$ sudo /etc/init.d/mysql stop
Step 2: Start the MySQL server without password
$ sudo mysqld_safe --skip-grant-tables &
Step 3: Connect to the MySQL server using the MySQL client
$ sudo mysql -u root
Step 4: Change the password for the root user
mysql> use mysql; Database changed mysql> update user set password=PASSWORD("YOUR_NEW_PASS") where user = 'root'; Query OK, 3 rows affected (0.01 sec) Rows matched: 3 Changed: 3 Warnings: 0 mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye
Step 5: Stop the MySQL server again
$ sudo /etc/init.d/mysql stop
Step 6: Start the MySQL server (normally) and test the new password
$ sudo /etc/init.d/mysql start $ sudo mysql -u root -p
This should also work on Windows as well, you will just need to use different commands for start/stop of the MySQL deamon.
If you happen to be using Windows 7 and you delete a file by mistake (or changed your mind 😉 ), there is an easy way to restore it.
- Go to the folder that has the file
- Right click in it (on the empty surface, not on an icon)
- Click Properties
- Click the tab called Previous Versions
- Locate the file that you want to restore
These files are created based on when Windows is performing System Restore points so you might want to modify those settings if you are more advanced user. They are performed on every restart by default, certain periods of the day, after installing some application etc.
The above can be performed also on a file that has been modified but it is still present:
- Right click on the file
- Select Properties
- Click the Previous Versions tab
- Select the version you want to restore
This restore procedure will work on all kind of files, database files, Word documents, text files, images etc.
If you have setup your Windows machine to perform automatic updates, when a new update is available it will nag you with a popup message to restart your computer so that the updates can be applied.
There are several ways to disable or post-pone this from annoying you every 10 minutes (default setting).
- Disable the Automatic Updates Service for the current session, meaning it will not show up this message until the computer is restarted. Note that this will be reset after the restart so you will need to repeat it again next time when you have new updates to be applied. To disable the automatic updates for the current session type the following in the Run screen in Windows (Start -> Run):
sc stop wuauserv
- Modify the group policy settings so the time between message popup is greater than the default value. Open the Group Policy Settings by entering gpedit.msc in Start -> Run. On the screen that will open, go to the following location:
Local Computer Policy
Now, locate the Re-prompt for restart with schedule installations option in the list and double click on it.
Set it is as Enabled and change the waiting period to 1440 minutes (maximum value == 1 day). Enjoy the uninterrupted work! 🙂
Note: Option 2 works only on Windows XP Professional and not on Windows XP Home. However, option 1 works for all versions of Windows XP. These options were not tested on Windows 7, but they might work there as well.
Recently I needed to add applications in Windows 7 which are only compatible with Windows XP. I discovered the Virtual PC in Windows 7 and the Windows XP Mode. It is great concept and it works quite nice because you don’t notice any difference to the applications (except some RAM usage), but there is a little problem for non-installable applications. They do not show in the Windows XP Mode menu automatically.
I noticed that only some applications are listed in the Windows XP Mode list and the one that I needed was not available there. You are able to add any application in that list by performing the following:
- Start Windows XP Mode in Desktop mode
- Create a shortcut of your application’s main executable file (.exe)
- Move the shortcut file (.lnk) in the following path: C:\Documents and Settings\All Users\Start Menu\Programs folder
The application should be now available in the Start Menu under Windows XP Mode.