MySQL basic operations and data types

Source: Internet
Author: User
Tags name database

Enter the mysql:mysql-hlocalhost-uroot-p;mysql-uroot-p password; View the Help document: Assist view name database (s); Create databases database_name Create databse if not exists database_name; Modify the character set of the databases: ALTER DATABASE database_name DEFAULT CHARACTER set character encoding name; display database: Show D atabases; Displays the details of a database (encoding set): Show CREATE database database_name; Select databases: Use database name; select * form db.table; Delete database: Drop database database_name; stop MySQL server: mysqladmin-uroot-p password shutdown;  view MySQL supported data types: show ENGINES; view default storage engine: Show Variables like '%storage_engine% '; Modify the default storage engine My.ini:default-storage-engine=innodb; Note Restarting the MySQL server to restart the MySQL server: Under Services, view the MySQL properties, locate the path, and run the path directly on the command line to start. Data type: 1. Integer types Smallintmediumintint and INTEGERBIGINT2. Floating-point type, bit type: Floatdoubledec and DECIMALBIT3. Date and Time Type: DATEDATETIMETIMESTAMPTIMEYEAR4. String type: Charvarchartinytexttextmediumtextlongtextbinaryvarbinary Creating table: CREATE TABLE table_name (data name data type,..,..); Show CREATE TABLE table_name (\G), used to view table Insert data: INSERT INTO TABLE_NAME values (content); Find data: SELECT * from Table_name;select now (); Current time    View error log: My.ini search DataDir Find the MysQL Directory Lookup service for error log files: Settings-Administration Tools-services (can find MySQL service under service, which can be found My.ini) Netstat-an with old view Port enabled . 

Basic MySQL operations and data types

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.