Re-learning MySQL data type (i)

Source: Internet
Author: User

required fields in//{} | The same as in PHP [] optional
< viewing error alerts >
SHOW WARNINGS;
</viewing error alerts >

< log in to the database and exit >
MySQL [-H site] {-u user name} {-p password} [-P port]
exit;
</Login database and exit >

< parameters when creating a database >
CREATE {DATABASE | SCHEMA} [IF not EXISTS] db_name [DEFAULT] CHARACTER SET [=] charset_name;
CREATE DATABASE Example;//create database if not EXISTS example;//create batabase if not EXIST example DEFAULT CHAR Acter SET ' UTF-8 ';
</Parameters > When creating a Database

< view databases >
show databases;
</View Database >

< View database encoding methods >
Show Create Database dbname;
</View Database encoding method >

< Modify database encoding >
ALERT {DATABASE | SCHEMA} [Db_name] [DEFAULT] CHARACTER SET [=] chatset_name;
Alert Database dbname Character set = ' code ';//alert database dbname Character set ' code ';
</modifying database encoding >

< Delete a database >
Drop{database | SCHEMA} [IF EXISTS] db_name;
DROP Database IF EXISTS example;
</Deleting a database >

< working with databases >
USER DATABASE;
</using Databases >


< data types >
Data type refers to the column, stored process parameters, expressions and local variables of the data characteristics, determines the data storage format, representing different information types
< integral type >


</Integral type >

< floating-point >


</floating-point >

< date and Time type >


</date and Time type >

< character type >


</Character type >
</Data Type >

Re-learning MySQL data type (i)

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.