Posts

Showing posts from 2012

Reset MySql Root Password

One of the very worst scenarios for a system administrator is when they forget a password for the root account. That is the same case when a Database admin does the same for the root account for Mysql Database. So to help here, these are the following steps which one can perform to recover the root password back for Mysql database. Stop Mysql Server: $ sudo /etc/init.d/mysql stop Then, start the mysql server with skip-grant-tables options. –skip-grant-tables option will force the mysql process not to read the user table into memory, so that when you try to login to the Mysql server, it won’t ask for the password. $ sudo mys qld_safe --skip-grant-tables  & This command is very dangerous if you Mysql server is connected to the network. While you are recovering your password, someone can login to your server remotely and do whatever he/she wants. To keep that safe, start your server with “–skip-networking” option, which will not open a network port for the server $ mysql

Installing Sun JAVA in Ubuntu

Step by step: Download  JDK  from  Sun/Oracle . Choose bin version (not rpm). The file would be in form of  jdk-version-platform.bin  (in my case it was:  jdk-6u25-linux-x64.bin  ) Add execution rights to the downloaded file $ chmod u+x jdk-6u25-linux-x64.bin Execute script. It will unpack its content to current directory (press  Enter  when asked) $ ./jdk-6u25-linux-x64.bin Now you should have directory i.e.  jdk1.6.0_25/  with  JDK  files in it. Move unpacked  JDK  to final destination e.g.  /opt/java/ $ sudo mv jdk1.6.0_25/ /opt/java/ Create symbolic link to that directory that will represent this  JDK  in general regardless current version. It will ease the future updates of  JDK . I can any name. I have chosen  sun-java6-manual $ cd /opt/java/ $ sudo ln -s jdk1.6.0_25 sun-java6-manual Now create another symbolic link in  /usr/lib/jvm  pointing to previous one. $ cd /usr/lib/jvm/ $ sudo ln -s /opt/java/sun-java6-manual I assume that you have already installed  Sun JDK  

How to Back Up and Restore NTFS and Share Permissions Using ICACLS

To save: D:\> icacls D:\acltest /save perms.txt /t /c processed file: D:\acltest processed file: D:\acltest\Screens processed file: D:\acltest\Trooper.txt processed file: D:\acltest\web-core.jar processed file: D:\acltest\Screens\adminGroup_perms.JPG processed file: D:\acltest\Screens\admin_perms.JPG processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdminGroup_perms processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdminGroup_perms processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdmin_perms_1.JPG processed file: D:\acltest\Screens\AdvSecuritySetting_AllowAdmin_perms_2.JPG processed file: D:\acltest\Screens\AdvSecuritySetting_AllowEveryone_perms_1. processed file: D:\acltest\Screens\AdvSecuritySetting_AllowEveryone_perms_2. processed file: D:\acltest\Screens\AdvSecuritySetting_DenyAdmin_perms.JPG processed file: D:\acltest\Screens\AdvSecuritySetting_noInherit_perms.JPG processed file: D:\acltest\Screens\EffectivePerm_Everyone_1.JPG pro

xampp mysql remote access

To allow remote connections to mysql server on windows follow the steps below: 1) Login to mysql server through command line and execute the following query:  GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'password'; 2) open the my.ini located inside the folder "C:\xampp\mysql\bin"     uncomment the line and replace 127.0.0.1 to           bind-address 0.0.0.0

VNC Server On Ubuntu

#sudo apt-get install vnc4server Now setup a password to login using the following command. It will prompt to setup a password and verify it #vncpasswd Than run the vnc server using #vncserver :1 Now before you proceed kill it once using #vncserver -kill :1 Now open the config file from .vnc/xstartup or ~/.vnc/xstartup using editor .vnc/xstartup  Than uncomment the line which says unset SESSION_MANAGER And add sh to the line below it like this exec sh /etc/X11/xinit/xinitrc Exit the file and run the command as below  #vncserver :1 -depth 16 -geometry 1024×768 connect using <ip-addr>:1 (:1 is for the vnc server window) You now have GUI access to your server.

Howto Build a MySQL Cluster in Debian Based Systems

Image
About the MySQL Cluster Each MySQL Cluster host computer running an SQL node must have a MySQL binary installed. For management nodes and data nodes, it is not necessary to install the MySQL server binary, but management nodes require the management server daemon (ndb_mgmd) and data nodes require the data node daemon (ndbd). It is also a good idea to install the management client (ndb_mgm) on the management server host. This section covers the steps necessary to install the correct binaries for each type of Cluster node. This may be confusing but will make sense later. In this example, we will use 5 Debian Lenny servers. You should start with a clean operating system installation for this tutorial. If you've already tried installing MySQL packages, you may have problems due to inconsistencies. All steps below should be performed as root. The 5 servers to be used in this tutorial are as follows: mysqlmanagement.example.com: 192.168.1.10 [ mysqlmanagement ] mysqlnode1.

How to Restore the Windows 7 MBR (Master Boot Record)

Image
1. Boot your computer to the Windows 7 DVD (or to a " Repair CD "). At this screen choose to install now. 2. Select your language and click next. 3. Click the button for "Use recovery tools". 4. Then select "Command Prompt". 5. When open, the command prompt will look like this: 6. The command we will use, bootsect.exe, is in a folder (named boot) on the DVD. We need to know what drive letter has been assigned the DVD drive to access the folder. Code: Type: diskpart and press Enter Type: select disk 0 (zero) and press Enter type: list volume and press Enter In this screen shot, the 7 DVD is letter: G 7. Use your DVD drive letter and Code: Type: exit and press Enter to close Diskpart Type: G: (use the letter of your DVD drive) and press Enter Type: cd boot and press Enter Type: dir and press Enter to verify that bootcect.exe is there (if you really need to) 8. To restore the "bootse

Using Diskpart to Create Partition in Windows 7

Image
1. You will first need to shrink a partition or volume to create a unallocated partition to use to create the new partition or volume with. 2. Open a elevated command prompt , or a command prompt at boot . 3. In the elevated command prompt, type diskpart and press Enter . (See screenshot below) 4. In the elevated command prompt, type list disk and press Enter . (See screenshot below) NOTE: This is to help you ID the disk number that has Free unallocated space that you want to create a new partition with. For example, Disk 1 with 80 GB of free space. 5. In the elevated command prompt, type select disk # and press Enter . (See screenshot below) NOTE: You would substitute # for the disk number listed that you want to create a new partition with the free unallocated space there. For example, I want to create a new partition with the 80 GB of free space, so I would type select disk 2 and press Enter . 6. In the elevated command prompt, type create

Reinstalling GRUB 2 from LiveCD

If you cannot boot from GRUB 2 and need to reinstall it, here is the simple method. For more details or for advanced options, refer to the Ubuntu community documentation here: Grub2 - Reinstalling GRUB 2 : Boot the Ubuntu Live CD (Try without installing). From the Desktop, open a terminal - Applications, Accessories, Terminal. Determine your normal system partition - `sudo fdisk -l` (That is a lowercase L) If you aren't sure, run `df -Th`. Look for the correct disk size and ext3 or ext4 format. Mount your normal system partition: Code: sudo mount /dev/sdXY /mnt If you aren't sure if you mounted the correct partition, once it's mounted run "nautilus /mnt" to inspect the partition. If it is the correct partition, you should see the normal Ubuntu folders such as /bin, /boot, /etc, /home, etc Example: sudo mount /dev/sd a1 /mnt Note: The partition to mount is normally the partition on which Ubuntu was installed: sda1, sdb5, etc. If you have a

i-nodes In Linux

Image
What is inode? In  computing , an  index-node  (inode) is a  data structure  on a traditional  Unix -style  file system  such as  UFS . An inode stores all the information about a regular  file ,  directory , or other  file system  object, except its data and name. (as defined in Wikipedia) The Inode is a pivitol structure within the Unix filesystem. The purposes of an inode is to hold all the information about a file you would normally expect to see in a directory entry on another system - file size, location, access & modification times, ownership, etc. To exist in a filesystem every file must have a inode. Directories, symbolic links, device files and pipes all have inodes. When the inode table is full so is your filesystem, no matter what 'df' is saying about the amount of free space. The size of the inode table is fixed when it is created, there is no command to extend it. Solaris users can examine the state of their inode table using