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