1.MySQL Basic Command operation
All MySQL commands need to end with a semicolon, and a single command can be written into multiple lines.
Connection database:mysql–u root–p;
View all databases:show databases;
Creating a database: Create databasesdatabaename;
Select database: UsedatabaseName;
Database operations can be performed only after the database is selected.
Delete databases:drop database databaseName;
Creating table: Create TABLE use(ID varchar () primary key, name varchar (TEN) not null);
View all tables:show tables;
Delete tables:drop table tableName;
2. Character Set
MySQL character set is Latin by default during installation and does not support Chinese. This will cause great problems in the actual development process, so it is generally necessary to modify the character set to UTF8. When installing in Windows, you can choose the default character set of UTF8, but it is not possible to use command installation directly under Linux, and it is more complex to modify the character set under Linux (several times you have encountered a problem). Personal feel can try to transcode the way, similar to Java in Urlencoder and Urldecoder methods, hbase data stored in the Bytes.tobytes method, so there will be no garbled problem, the disadvantage is that the encoding and decoding need to consume time.
3. The most basic VI operation
Although the graphical user interface to modify the file is very convenient, but some time must be modified by VI, but the VI is powerful, but also complex. Very basic a few VI command, later to use again to learn it.
There are three states of VI: Input Mode,command mode and line mode.
1) Enter file:vi filename;
2) at the beginning of VI, automatically in command mode, press i from command mode into input mode;
3) in input mode, the same as normal file modification;
4) After the modification is complete, press ESC to return to command mode;
5) Enter the ZZ archive and Exit VI, if an accident happens halfway through the command : q! Force leave (no changes are saved).
The most basic MySQL command and VI command