Thursday, April 15, 2010

Generating a MySQL database alter script using MySQLWorkbench

MySQL Workbench facilitates in generating mysql database creation and alteration scripts. Though the creation is straighforward, (File > Export > Forward Engineer SQL Create Script), a correct alteration script isn't simply generated.

One more thing about creation, before I can delve into the work around required for generating alteration script using MySQL Workbench is that, when we generate the create script, the tool adds the db qualifier mydb by default. And, there is no way I could find to change that. So, I remove the qualifier manually whenever I generate the script.

Now, if we have a working database, for which a mysql creation script does not exist or even if it does, it most probably won't contain the mydb qualifier, without which the MySQL Workbench does not generate a correct alteration script. So, for the alter script generation to work correctly:
  1. Export the existing database structure using any mysql client as a script.
  2. In MySQL Workbench: File > Import > Reverse Engineer MySQL Create Script
  3. File > Export > Forward Engineer MySQL Create Script, will generate the sql create script for the existing database with the mydb qualifier.
  4. File > Export > Forward Engineer MySQL Alter Script.
  • Input File: is the path to the sql script for existing database, with the mydb qualifier (the one that was generated in Step 3).
  • Output File: is the path to the alteration file, that is to be generated.
  • Select Next
  • Select Execute
  • Now, one can remove the mydb qualifier from the generated file (using search/replace in one's favorite editor)

Monday, January 11, 2010

How to format usb flash drive in ubuntu.







Instructions

  1. Plug your flash drive into an empty USB port, then back up any data on the drive. Open the main menu, move your cursor over "Accessories," then click on "Terminal." At the terminal prompt type "sudo apt-get install gparted" (without quotes) then hit the "Enter" key on your keyboard.
  2. Enter your Ubuntu administrator password when prompted, then hit the "Enter" key again. This will download and install GParted which is an open source drive partitioning program.
  3. Go to the Ubuntu main menu after the installation is complete, move your cursor over "System," then "Administration," then click on "Partition Editor." Enter your administrator password when prompted, then click "OK."
  4. Click on "GParted" in the toolbar then hover over "Devices" and select your USB flash drive from the list (dev/sdb1 for example). Right-click on the device in the main GParted window, then click "Unmount." It may take a few minutes for the device to be unmounted.
  5. Right-click on the device again (after it is umnounted) then hover over "Format to." Select the desired file system type (RiserFS, linux-swap, Ext 2/3, or FAT16/32 for example), then click "Apply" in the toolbar. Depending on the size of the flash drive, it will take 3 to 4 minutes or so for GParted to complete the process.
  6. Close GParted after the flash drive is formatted. To mount your USB flash drive, unplug it and then plug it back in. The drive is now ready to store data in the file format you selected.

Friday, January 8, 2010

How to create Paypal Buy Now Button in Paypal SandBox - Testing Environment.(Part 2)

How to create Paypal Buy Now Button in Paypal SandBox - Testing Environment.

Simply follow the instructions available on the link as follow:

http://hubpages.com/hub/How-to-refund-back-to-your-customer-using-Paypal