Pages

Friday, July 16, 2010

Tools to connect to Mysql server

Here are the list of tools you can use to connect to your mysql server other than using the command prompt:

  1. phpMyAdmin: This is a web based application to manage your database online.
  2. Mysql Query Browser
  3. Toad for Mysql: This is a freeware development tool for Mysql on windows platform.

Tuesday, July 6, 2010

Integrate Apache,PHP,Mysql on Windows

Follow these steps:


To install Apache:
  1. Downlaod the latest version of apache server for windows from http://httpd.apache.org/download.cgi
  2. Downlaod the .exe file instead of binary
  3. Run the installer.
  4. On the "Network Domain" and "server name" put "localhost"
  5. Put your emailid
  6. Then choose the default recommendatios.
  7. If you are choosing "Custom",then you can choose the options you want to keep and it will affect your httpd.conf file.
  8. Once done, you can test whether apache server is running by typing: http://localhost/ on browser and it will show a default html message as "It works".
To install PHP:
  1. Download the latest version of php for windows from http://www.php.net/downloads.php
  2. I normally download the binary but you can download the installer and run.
To install mysql:
  1. Download the latest version if mysql from http://dev.mysql.com/downloads/
  2. You can aslo download Mysql AB Query Browser as well as Mysql Adminstrator.
To integrate PHP,Mysql with Apache:
  1. Open your httpd.con file.
  2. Change the Document root to the working directory path where you will have all your project files.
  3. The same path should be for where it is mentioned Optionss Indexes FollowSymLinks
  4. Add index.php in "DirectoryIndex" filles, it will become DirectoryIndex index.html index.php index.html.var
  5. Where you have all the Add-type listed, add at the end "AddType application/x-httpd-php .php"
  6. At the very end of you conf file add PHPIniDir "full path to folder where php.ini file exists"
  7. Add LoadModule php5_module "path to/php/php5apache2.dll" (where php is installed, like c:/proram files/)
  8. If you are using PHP 5.2.x series then load php5apache2_2.dll
  9. Save the file
  10. Open php.ini file, and uncomment the extensions that you want to keep like mysql,openssl,curl etc
  11. To integrate with mysql, we need to move libmysql.dll as well as libmysqli.dll under windows/system32 folder.
  12. Restart the server.
  13. Check you configurations using phpinfo();

Monday, June 28, 2010

Interspire Shopping Cart

I have used Interspire shopping cart for few of my ecommerce websites and the product is really amazing. The only thing that hurts is it is quite expensive.
I really like the templates and within few customization you are ready to go live with your website.

To use Interspire shopping cart, one doesnt need to be a programmer and with basic html skills you can easily setup the website.
You can add videos,images in your product description. You can shopy by brand, shop by price as well as define discount rules easily for each product.
You can also set product discounts on user groups.

I will recommend using Interspire shopping cart if cost is not a constraint.

Changing frontpage in wordpress

The proces is:

1. Login to your admin panel

2. Under "Pages", add a new page which you want to set as homepage and publish it.

3. If you want a page that shows recent posts as well then create a post and name it as "blog" or whatever you wish to name it.

4. Go to Administration->Settings->Reading.

5. Here you will find an option to display "Front page" as most recent posts (this is selected by default) or as static front page.

6. Choose "static front page" and from pages select the page to display.

7. Under posts, select "blog" or the post title under which you want your blog recent posts to be listed.





Tuesday, February 16, 2010

Optimize for high performance of mysql database

I have been using Mysql for most of my projects. While designing the database the question is to make it faster and effective so that the performance doesn't get affected in the long run.

Here are few guidelines that I follow and I am summarizing it here: 

Indexing:
  • Add indexes to columns which are frequently used in the where clause of your sql statement. ALTER TABLE [tablename] ADD INDEX (col);
  • You Don't have to  Index everything on the where clause.Primary Keys are already indexed.
  • If in a table lots of inserts are happening compared to select than dont index that table as that increases the overhead.
  • Avoid null values in column which is indexed.   
Optimize tables
  • This will speed up the loading time. OPTIMIZE table [tablename];

Optimize SQL queries
  • Run "explain query" statement to see which indexes are used.
  • Avoid using "select * from table" in your query. Fetch only those columns which are required.
  • Always have "Slow Query Log" ON.
  • Use stored procedures instead of inline queries when possible. As stored procedures are stored in the database server the execution time is faster with respect to inline queries.
  • Use correct datatype and set the length appropriately.
  • MYISAM is faster than INNODB; so use MYISAM when there is no transaction related function required.