May 31 Class Note-mysql Introduction

Source: Internet
Author: User

I. MySQL configuration mysql environment variable add D:\Program files\mysql\mysql Server in Path5.7\ bin cmd command: login: MySQL-uroot-p exit: Exit;    Service startup: Net start MySQL service stop: net stop mysql common database: Oracle: Product free, service charge SQL Server MySQL: widely used DBMS: Database management System (C3P0 connection pool JDBC) MySQL default database engine: InnoDB mysql configuration file My.ini Modify profile requires restart database service effective II. MySQL database statement CRUD (Increased and censored) DML (data manipulation language) Insert, UPDATE, delete DQL (data query Language) Select DDL (data definition Language) Create, DROP, alter DCL (Data Control Language) G Rant,commit,rollback arithmetic operator: Select5+9; Logical operator and OR not&& | | !comparison operator: equals=Not equal to<>! =View all databases show databases;    Creating database: Create database name;    Select database use database name; Delete databases: drop database name; third, MySQL graphical management tool navicat forMySQL or sqlyog mysql data type: Numeric type: tinyint smallintint(Standard integer) BIGINTDoubleDecimal (m,d) string date type:Char(fixed-length string) varchar (variable-length string) text (text string) date (month-day) datetime (yyyy-mm-DD HH:mm:ss) timestamp timestamp year Four, table action CREATE TABLE: statement Comment: Single line comment: # Multiple lines NOTES:/* */Create TABLE student (Studentnoint(4) Not NULL PRIMARY KEY COMMENT ' School Number ', Loginpwd VARCHAR () notNULLCOMMENT ' Password ', Studentname VARCHAR (Not NULL COMMENT ' name ', Sex CHAR (2) Not NULL DEFAULT ' male ' COMMENT ' sex ', Gradeidint(4) UNSIGNED COMMENT ' Grade number ', phone VARCHAR (COMMENT ' mobile phone number ', Address VARCHAR (255) DEFAULT ' address unknown ' COMMENT ' address ', borndate datetime COMMENT' Date of birth ', email VARCHAR (COMMENT ' Mail ', Identitycard VARCHAR (UNIQUE KEY COMMENT ' id ') COMMENT' Student table ';  Show tables;  View all table desc table names under the database;    View all the fields in the table Delete table: The name of the drop table table; To modify a table:

May 31 Class Note-mysql Introduction

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.