First, connect the database
1. Start and close the MySQL server
Start server: net start MySQL
Shut down the server: net stop MySQL
2. Client login and log out MySQL login mysql
Mysql-h IP address-u user name-p password
-H IP address does not write default native localhost
-u username, you can use Super Administrator root, or you can specify the user name
-p password, you can also lose-p Enter, enter the password input line
=
Quit MySQL
Quit or exit
Second, set the black window to get character encoding
Can see in the CMD window its character encoding is GBK, if MySQL set the database encoding format is not GBK, when input Chinese data will be error, when the Chinese data will be garbled
For example, insert data in a table:
Get Data with Chinese
To resolve this issue simply execute the command set names GBK after entering the MySQL server
III. Classification of SQL statements
DDL: A data definition language used to define database objects: libraries, tables, columns, etc.;
DML: A data manipulation language used to define records for a database;
DCL: Data Control language used to define access rights and security levels;
DQL: A data query language used to query records.
SQL statement Collective content see the next article: MySQL command Daquan--ddl, DML, DCL
mysql Command encyclopedia-Basic operations