One: MySQL system-level operation and basic grammar rules
Installation and configuration of the A.mysql database (slightly)
B. Start/stop MySQL database service
1. Command line mode:net start/stop mysql (cmd opens as Administrator)
2. Service mode: My Computer Management Service 〉mysql > Start/Stop
C. Log in/out of MySQL database system
1. Login:mysql-h server address-u login name-P port number-P
2. Exit: Quit; or exit;
3. Note: After logging into the database system, you need to use "set names encoded name;" To set the "Environment code name" of the current connection database, which is the encoding of the "client" itself that is currently dealing with the database. Generally speaking,
The CMD client is a fixed GBK encoding, while the PHP Web page is the encoding of the page file (now the mainstream is UTF8).
D. backup/Restore Data
1. Backup:mysqldump-h server address-u login name-P port number-p database name > file name
-
- Note: Administrator privileges are required;
2.mysql-h server address-u login name-P port number-p database name < file name
E. Basic grammar provisions
1. Notes
A. Single-line comment: #注释内容
B. Single-line Comment:--note content (note that there is a space after two "--")
C. Multiline Comment:/* Comment content */
2. Statement lines
A. A statement is also called a command, usually with a semicolon (;) end; You can also set a new terminator by using the delimiter new Terminator command.
B. The execution of a statement is performed in a single statement, one statement at a time.
3. Case
The various system keywords and command names in A.mysql are case-insensitive
The case of a custom name (identifier) in B.mysql, some distinctions (related to the operating system), some do not distinguish, see the following "naming rules"
4. Naming (identifier) Rules:
A. Names that can be named, called identifiers, include: Database name, table name, field name, view name, function name, procedure name, variable name, user name, and so on.
B. There are more characters that can be named identifiers than in regular languages, but it is recommended to use only: alphanumeric and underscore, and do not start with a number.
C. Non-regular characters or system keywords can be used as identifiers, but it is best to wrap them in an inverted quotation mark (the inverse of the number 1 left), and is not recommended.
D. The database name, table name, and view name, are not case-sensitive in the window system, while other systems are differentiated, it is recommended to use lowercase, and underline segmentation method.
E. Name identifiers (field names, function names, procedure names) that are not case-sensitive, but are also recommended to use lowercase, with the underscore split method
MYSQL (2)