First, the database change password
① executes the use MySQL first;
② Execute update mysql.user set Password=password (password to be modified) where user= ' root ';
MySQL User name: root
MySQL Password: modify it Yourself
MySQL server address: localhost
Two
MySQL Database (relational database)
1. Name: string: varchar; string length: Common 20-bit and 50-bit; allow null value;
2. Gender (Sex): bit, generally with Boolean data, common code 1 = male, 0 = female;
3. Age: Shaping int;
4. Address: string varchar, commonly used length is 50 bits;
5. Class (Class): string varchar,
6.text: No length limit, can save picture (convert picture to binary stream)
7. Primary key PK (Primary key): A data table must have a primary key, representing a piece of data, identified as the key;
8. Self-growth columns: to avoid duplication, or to find a suitable primary key, the data grows automatically whenever a row is inserted;
9. The table has been split until it can not be split, the more the table, the better;
10. Foreign key (foreign key): Must have two tables (main table, from table), master Table control from the table, select the main table from the table, the foreign key column in the main table must be the primary key;
11. FOREIGN Key relations: advantages (Security), shortcomings (slow productivity, if the establishment of external relations, the main table can not be deleted, modified); The company does not require the establishment of foreign key relations can not be used;
12. Rule: three main paradigms of database
① first paradigm: Guaranteeing the atomicity of each column (each column cannot continue to be demolished);
② Second paradigm: Ensure that each column of the data table is related to the primary key;
③ Third paradigm: Ensure that each column of the data table is directly related to the primary key (standard criteria for data tables);
The first paradigm of ④ must be satisfied;
13. Rule: ① splits the table until it cannot be split;
② table name plus prefix, name lowercase
③ if a column suitable for the primary key is not found, the self-growing column is used;
④ foreign key relationship can not add, see if there are special requirements;
Initial knowledge of MySQL (relational database)