Tuesday, April 23, 2013

How to turn on or off full text indexing in MS SQL server with sp_fulltext_database

Here is the snytax for it.


sp_fulltext_database [@action=] 'action'


action is an argument and it's type of varchar(20) and it could be enable or disable

To turn on full text indexing in MS SQL server with sp_fulltext_database try this.


USE Database_name;
GO
EXEC sp_fulltext_database 'enable';
GO


To turn off  full text indexing in MS SQL server with sp_fulltext_database try this:


USE Database_name;
GO
EXEC sp_fulltext_database 'disable';
GO

To run sp_fulltext_database you have to be db_owner or sysadmin 

Wednesday, April 17, 2013

Login to MySql database form command line

To login to MySql database from a commend line you can use

mysql -u root -p;

after hitting enter system will ask you for the password or you can use this command

mysql -u root -pPassword;

Once login to the database you have to select the database to work with.

MySql view database list, switch database and list tables

If you are running MySql form command line and you like to see list of all the database then simply run this command after login to the mysql

show databases;

this command will list all the database that are on MySql server.

If you like to work with one of the database then you can select the database with.

use database_name;

Once in the Database you like to see the list of the table use.

show tables;

This command will show the list of all the tables in that database.


MySql Backup Database with mysqldump

To backup MySql Database from command line.

mysqldump -u user_name -p Database_Name > backup-file.sql

In windows xp, 7, or 8 simply run the above command in CMD. It will place the backup-file.sql in the same direcotry where you run the command from.

for more information look at mysqldump