To change the character set to latin1 for the BookSales database, use the following ALTER DATABASE statement : CHARSET « I18N « SQL / MySQL

Home
SQL / MySQL
1.Aggregate Functions
2.Backup Load
3.Command MySQL
4.Cursor
5.Data Type
6.Database
7.Date Time
8.Engine
9.Event
10.Flow Control
11.FullText Search
12.Function
13.Geometric
14.I18N
15.Insert Delete Update
16.Join
17.Key
18.Math
19.Procedure Function
20.Regular Expression
21.Select Clause
22.String
23.Table Index
24.Transaction
25.Trigger
26.User Permission
27.View
28.Where Clause
29.XML
SQL / MySQL » I18N » CHARSET 
To change the character set to latin1 for the BookSales database, use the following ALTER DATABASE statement
    
mysql>
mysql> CREATE DATABASE BookSales
    -> DEFAULT CHARACTER SET latin1
    -> DEFAULT COLLATE latin1_bin;
Query OK, row affected (0.00 sec)

mysql>
mysql>
mysql> ALTER DATABASE BookSales
    -> CHARACTER SET latin1;
Query OK, row affected (0.00 sec)

mysql>
mysql> drop database BookSales;
Query OK, rows affected (0.00 sec)

mysql>

   
    
    
    
  
Related examples in the same category
1.Set DEFAULT CHARSET=latin1
2.The CHARSET() function identifies the character set used for a specified string
3.Get CHARSET
4.Get the charset and collation information
5.Optionally, you can specify a default character set and sort order:
6.Change the Character Set of All Text Columns
7.MySQL Character Set Variables
8.Changing the Character Set
9.Specifying the Character Set of a Character String (Cast Operator)
10.CREATE DATABASE statement specifies the character set and collation:
11.CONVERT( USING )
12.Check the character set
13.Check the character set name and description
14.Character setting for char type column
15.CHARACTER SET utf8 for column definition
16.CHARACTER SET 'latin1', CHARACTER SET 'hp8'
17.Check the character set settings
18.Check the default character set name
19.Table with default chartset= latin1;
20.Set default character during table definition
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.