MYSQL creates a database in UTF-8 format _ MySQL

Source: Internet
Author: User
MYSQL creates a database in UTF-8 format, bitsCN.com

MYSQL creates a database in UTF-8 format

Start with mysql:

Linux code

GBK: create database test2 default character set gbk COLLATE gbk_chinese_ci;

UTF8: create database 'test2' default character set utf8 COLLATE utf8_general_ci;

Eg:

Linux code

[Root @ linuxtest test] # mysql-u root-p

Enter password:

Welcome to the MySQL monitor. Commands end with; or/g.

Your MySQL connection id is 5

Server version: 5.1.30-community MySQL Community Server (GPL)

Type 'help; 'or'/h' for help. type'/C' to clear the buffer.

Mysql> create database 'test' default character set utf8 COLLATE utf8_general_ci;

Query OK, 1 row affected (0.06 sec)

Mysql> show databases;

+ -------------------- +

| Database |

+ -------------------- +

| Information_schema |

| Cacti |

| Mysql |

| Test |

+ -------------------- +

5 rows in set (0.07 sec)

This test Library is in UTF-8 format.

BitsCN.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.