Basic Mysql operations and Data Types

Source: Internet
Author: User

Basic Mysql operations and Data Types
Go to mysql: mysql-hlocalhost-uroot-p; mysql-uroot-p password; view the help document: help to view the database name (s); create database: create database database_name; create databse if not exists database_name; modify the character set of the database: alter database database_name default character set character encoding name; display database: show databases; display detailed information of a database (sequence SET ): show create database database_name; select database: use database Name; select * form db. table; delete database: drop database database_name; stop mysql Server: mysqladmin-uroot-p password shutdown; view the data type supported by mysql: show engines; view the default storage engine: show variables like '% storage_engine %'; modify the default storage engine MY. INI: default-storage-engine = INNODB; restart the MySQL server to restart the MySQL server: view the mysql attributes under the service, find the path, and run the path directly in the command line to start. data Type: 1. integer SMALLINTMEDIUMINTINT and INTEGERBIGINT2. floating point number type, bit type: FLOATDOUBLEDEC and DECIMALBIT3. Date and Time type: DATEDATETIMETIMESTAMPTIMEYEAR4. string type: orders table creation: create table table_name (Data name data type ,..,..); show create table table_name (\ G); used to view the inserted data of a table: insert into table_name values (content); query data: select * from table_name; select now (); check the error log for the current time: my. search for datadir under ini and find the Directory Search Service for the mysql Error Log File: settings-management tools-Service (you can find mysql service under the service, and then find my. ini) netstat-an used to check the port activation status.

Related Article

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.