MySQL Full text search commands

1. Moving existing table from one engine to another-

ALTER TABLE table_name ENGINE=engine_name;

Engine names could be -> InnoDB, MyISAM

For further reference, browse thru “A fast and furious guide to MySQL database engines

2. MySQL Indexs” a glimpse.

3. Creating Full Text index and playing with it “How it works

4. Creating Full Text index on an existing table-

CREATE FULLTEXT INDEX index_name ON table_name (column_names);

5. Implementing Full Text search in Django using MySQL - “Extending Django’s database API to include full-text search

Posted via web from Varun Bansal’s weblog

MySql code snippet – mysqldump example

The following code snippet in SQL is occasionally used by me and I tend to forget the basic syntax or the same.

So here it is, just for reference for future use.

How to backup database in mysql:

Mysqldump –u username –p database_name > dump.sql

Posted via email from Varun Bansal’s weblog

Extending Django’s User Profile

In order to the save some extra information about a user,  you will need to extend the standard User object.

Go through the following set of links to get a deeper insight into extending User object in Django:

1.       A good explanation from Django Book @ http://www.djangobook.com/en/beta/chapter12/

2.       django-profiles project by James Bennett @ http://bitbucket.org/ubernostrum/django-profiles/wiki/Home

3.       http://shityoucantremember.wordpress.com/2009/02/14/unriddling-the-django-user-profile/

4.       http://www.amitu.com/blog/2007/july/django-extending-user-model/

5.       Displaying custom user profile in django admin http://www.thenestedfloat.com/articles/displaying-custom-user-profile-fields-in-djangos-admin

6.       http://wolfram.kriesing.de/blog/index.php/2007/extend-djangos-user-class

7.       http://www.codekoala.com/blog/2009/quick-django-tip-user-profiles/

8.       http://www.codekoala.com/blog/2009/quick-django-tip-user-profiles/

Posted via email from Varun Bansal’s weblog

Bangalore trip over. heading back home

My Bangaluru trip is done for this time. Waiting for the boarding @ the airport

Posted via email from Varun Bansal’s weblog

Closing Bangalore trip for this time. Heading back home

My Bangaluru trip is done for dis time. Waiting for d boarding @ the airport.

Lovely meeting Ramdas. Wil b back soon.

Posted via email from Varun Bansal’s weblog

Pycon Trip Begins

Pycon trip of mine hs begun wid a good omen – the lovely weather of Bangalore is making me gay ;)

A real respite after arriving frm the shining but burning Delhi. My flight landed in d afternoon and arrived

at my long time friends office situated on the outer ring road. Got a direct Volvo (#8) from airport to Intel.

Intel is a lovely place to work, as it seems to me frm d first impression. Nice big campus, with not so high bldgs

and very sparsely populated. Cafeteria is also big and food ws excellent. Stayed inside d campus for bout 45 mins,

den startd for my friend;s home in BTM (near Silk Board). Another 20 mins bus ride from his office.

Now, waiting for the first rays of the morning sun, to start for d showdown.

Posted via email from Varun Bansal’s weblog

Test post to check auto posting service

Test mail

Posted via email from Varun Bansal’s weblog

Dump data from sql file to database

from your command prompt, run:

c:\mysql -u user -p database_name < file_name.sql

(this will dump the entire data from the sql file to the provided database)

Creating backup of MYSQL database

from you command prompt, run:

c:\mysqldump -u user -p database_name > file_name.sql

(this will dump the entire database into the file)

check MYSQL engine type for table

SHOW TABLE STATUS WHERE Name=”table_name“;

or

SHOW TABLE STATUS;

(this will list all tables in the database)