Archive for January 2010

Redirection from one page to another using .htaccess

If you want to redirect one page to another page,  then add the following code in the .htaccess file  in one line :

[email protected][#] vi  .htaccess
=================================================

redirect 301 /oldfile.htm   http://www.domain.com/newfile.htm
=================================================

That’s all this will do it.



MYSQL COMMANDS

How to check mysql connection or  login to your Database using shell
=========================
[email protected][#] mysql -u username -p
=========================
it will ask for password then provide the correct password.

Create Database on the Mysql Server
=========================
mysql> create database [databasename];
=========================
ex : mysql>create database Dresses;

List all databases on the sql server.
===========================
mysql> show databases;
===========================

Switch to a database or use a database on the server .
===========================
mysql> use [database name];
===========================

To List all  tables in the  Database.
==========================
mysql> show tables;
==========================

To check the table Constraints or Describe table
==========================
mysql> describe [table name];
==========================

To Delete a Database
==========================
mysql> drop database [database name];
==========================

To delete a table.
==========================

mysql> drop table [table name];
==========================

How to find MySql Version

You can find the MySql Version with the help of following commands :

============================

[email protected][#] mysql  -version
[email protected][#] mysql -V
[email protected][#] #  mysql -e status | grep ‘Server version’

============================

That’s all.