Setting character sets for database in MySQL

MySQL can store data using various character sets. To view the supported character sets in your server run

mysql> show character set;

MySQL allows to set which character set need to use for database

create database some_db character set cp1250;

and for column

varchar(20) character set cp1250

Share

Avoiding problems with Date format in MySQL

If you construct a string with which to populate a date column and that string does not match the expected format,you will receive error. In this case MySQL has function str_to_date which specifies string format

mysql> update …set birth_data = str_to_date(‘FEB-12-1990′,‘%b-%d-%Y’) where …

Formatters:

%a –the short weekday name:Sun,Mon,… . . . →Read More:Avoiding problems with Date format in MySQL

Share

Getting query result in XML in MySQL

MySQL allows to generate XML output from query. It is very useful when you are working with XML data

mysql -u user_name -p –xml database_name

After that you can select data and result will be as an XML document.

Share

Creating and using databases in MySQL

In this post I am going to show simple examples which should help to understand how to create database,table,how to populate,update data in table and how to delete data from table and how to delete database. I will use MySQL database server which you can download from mysql.com.

. . . →Read More:Creating and using databases in MySQL

Share

Getting current time in MySQL

Simple command which shows current time in MySQL server:

mysql> select now();

Share

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna,tincidunt vitae molestie nec,molestie at mi. Nulla nulla lorem,suscipit in posuere in,interdum non magna.