Wednesday, April 25, 2012

How to : Connect MYSQL and phpMyAdmin


Due to security measures you cannot connect phpMyAdmin to MYSQL "out of the box". You require to set MYSQL root password first!

After installing XAMPP,if you try to connect to MYSQL using phpMyAdmin from Tools menu, you may be greeted with this message  Access denied for user: 'root'@'localhost' (Using password: NO)
The following steps will help to resolve this problem.
1. First Set the MYSQL root password from command line
2. Then edit "config.inc.php" file
3. Take some additional steps

Step 1.Set the MYSQL root password from command line
Suppose XAMPP is installed in c:\XAMPP
Switch to folder c:\XAMPP\MYSQL\bin
Run the following command
$ MYSQL -u root -p
you will be in MYSQL prompt. It clearly indicates that the  password was set initially as blank. Now the password need to be set first. Lets set the password as "linux".
2) First switch to MYSQL database. issue the following command
MYSQL> use MYSQL;
3) In order to change password for user "root", enter the following update command:

MYSQL> update user set password=PASSWORD("linux") where User='root';
4) Then run following commands to reload the privileges
MYSQL> flush privileges;
MYSQL> quit

Up to this stage we have set the MYSQL root password to "linux" from blank password. Now we have to tell about this change to config.inc.php file.
Step 2. Edit "config.inc.php" file
Switch to folder C:\xampp\phpMyAdmin
open config.inc.php file in text editor,go to block which has comment /* Authentication type and info */ .There you can set the root password as follows
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'linux';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
 Restart the XAMPP. Hope you will be able to connect to phpMyAdmin (tools-> phpMyAdmin)

3. Additional Steps: 
Check seurity of database

3.1. Click on Security tab to confirm that MYSQL root is protected. (http://localhost/security/). you should now able to see following.
The MYSQL admin user root has no longer no password                :    Secure
Done! Not only you get rid off from error but also secure MYSQL too.

Allow MYSQL to import larger sized file
3.2. By default MYSQL permit you to import file size upto 8MB .(MYSQL maximum import ax 8,192KiB). Must get rid off at this initial stage itself
Open php.ini file from c:\xampp\php folder and search for "post_max_size ". Change the value to 32.

Happy MYSQLing with phpMyAdmin

Sunday, June 12, 2011

Drive letter to Tape drive? How to assign drive letter to Tape drive in MS Windows?

Normally you cannot assign drive letter to Tape drive. By using LTFS, you will be able to assign drive letter to LTO tape drive.

Users are dealing with the media like Hard disk, CD/DVD/BD disks, floppy disks etc. In MS windows environment, a Drive Letter is assigned to accesses these media. In *NIX environment, these drives get access by mounting to mount point.

Here arises the question. Why cannot we use Tape drive in the same manner as we use other drives i.e by assigning the drive letter in MS Windows? Tape drive is one of the oldest storage mediums, while USB/SSD based drives are recent ones. One can access USB/SSD by assigning drive letters, but for tape it cannot be done (normally) …why?

To get answer,consider the following points:

(1) The way data being stored thus accessed on Tape drive is different then HDD/CD/DVD. In tape drive, data access is Linear or Sequential while in other drives it is Random.

(2) The way Meta information, for data access purpose is stored on the media. While HDD, CD/DVD and other media starts storing the information about their files and folders at beginning of disk (In case of HDD it may be in form of FAT/NTFS area, Root directory etc and in case of CD/DVD it is in form of TOC in lead-in area). This arrangement facilitates random access, thus assigning drive letter serves its purpose of Single point of reference. Tape doesn't have such Meta information for all of its data at the beginning. The file name, location etc information of file and folders is spread out, throughout the tape, stored normally at the end of each data block. To get list of files and folders in tape, all data blocks need to be accessed that too in linear way and then at the end of each data block, such information can be found. There is no such consolidated index of stored data in tape , no Single point of reference. Only tape backup/restore software creates such information after scanning the whole tape and stores in their own database..Above all, being the proprietary in nature, the tape drive get accessed and controlled by their special drivers and application software, which only can communicate and control tape drive. Windows cannot access tape as Nativity as it accesses other drives, thus eliminates the drive letter assignment.

The Tape industry is quite aware about it since long. Finally, the open source"Linear tape file system", LTFS is arrived in March 2011. Note that LTFS is not a panacea , it has limitations too: It works with LTO drivers only , that too with LTO-5 onward in full fledge manner. LTFS permits user to assign a drive letter to tape drive in windows and access the tape data in same manner as of HDD, CD/DVD or any other random access drive.

See what wikipedia writes about LTFS (hhttp://goo.gl/ilmmf )

" The Linear Tape File System is a method of storing file metadata on a separate part of the tape. This makes it possible to copy and pastefiles or directories to a tape as if it were just like another disk, but does not change the fundamental sequential access nature of tape."

So if you have tape drive which is not LTO, you have to access it in the same way as you are doing now. But if you are planning to go for LTO-5 and onwards you can access it by assigning drive letter to it using LTFS.

Post Your Comments....